https://sourceware.org/bugzilla/show_bug.cgi?id=20834
Bug ID: 20834 Summary: ld.gold on armel uses small page size, decreasing portability Product: binutils Version: 2.28 (HEAD) Status: NEW Severity: normal Priority: P2 Component: gold Assignee: ccoutant at gmail dot com Reporter: doko at debian dot org CC: ian at airs dot com Target Milestone: --- [forwarded from https://bugs.debian.org/844467] Apparently some ARM based NAS devices, such as the WD My Cloud EX2, have the kernel using a page size of 32k or 64k. Binaries linked with ld.gold on armel use a page size of 4k. Trying to use those binaries with such a kernel fails: "ELF load command alignment not page-aligned" Using the regular ld on armel, a 64k (0x10000) page size is used: # arm-linux-gnueabi-ld -o hello hello.o -lc # readelf -l hello | grep LOAD LOAD 0x000000 0x00010000 0x00010000 0x001d2 0x001d2 R E 0x10000 LOAD 0x0001d4 0x000201d4 0x000201d4 0x000b0 0x000b0 RW 0x10000 Using ld.gold, a 4k (0x1000) page size is used: # arm-linux-gnueabi-ld.gold -o hello hello.o -lc # readelf -l hello | grep LOAD LOAD 0x000000 0x00008000 0x00008000 0x001d2 0x001d2 R E 0x1000 LOAD 0x0001d2 0x000091d2 0x000091d2 0x000b2 0x000b2 RW 0x1000 ghc uses ld.gold to link haskell programs. Probably some other stuff links with ld.gold as well. This makes debian binaries, chroots, etc not as portable for use with such kernels as it could be. Workaround: Pass -z common-page-size=65536 -z max-page-size=65536 to ld.gold, however linking with -z common-page-size=65536 -z max-page-size=65536 fails: ld.gold.orig: internal error in do_write, at ../../gold/output.cc:464 It works using a 32kb page size. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils