mold: Linking with a specified common and max page size is broken

@rui314 Very recently linking with mold-git and a specified page size (I usually use -Wl,-zcommon-page-size=0x200000 -Wl,-zmax-page-size=0x200000) got broken, I suspect https://github.com/rui314/mold/commit/2941d75c717279fcb1df23acf4ed911b3d1e4daa or related changes from today to be the culprit.

With both GCC 12.2.1 and a snapshot from today of Clang-16, I now get errrors like /usr/bin/ld.mold: error while loading shared libraries: cannot apply additional memory protection after relocation: Cannot allocate memory when trying to compile with these flags and mold.

This also happens when compiling mold-git itself. I have just tested it, mold-git works fine when it is compiled without -Wl,-zcommon-page-size=0x200000 -Wl,-zmax-page-size=0x200000 but then starts to error out when using it with -Wl,-zcommon-page-size=0x200000 -Wl,-zmax-page-size=0x200000.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 31 (16 by maintainers)

Commits related to this issue

Most upvoted comments

@rui314 I’ve just tested current git head with GCC and the specified page size and it works fine again with that revert. Thanks!

But that PKGBUILD doesn’t include any max-page-size option, so there must be something hidden.