Although sys-apps/memtest86-4.3.7-r3 compiles fine with sys-devel/binutils-2.40, it fails to build with sys-devel/binutils-2.41, due to dynamic relocations and LOAD segment RWX permissions detected during linking. sys-devel/binutils-2.41: x86_64-pc-linux-gnu-ld --warn-constructors --warn-common -static -T memtest_shared.lds -m elf_i386 \ -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o memsize.o error.o smp.o cpuid.o vmem.o random.o && \ x86_64-pc-linux-gnu-ld -shared -Bsymbolic -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o memsize.o error.o smp.o cpuid.o vmem.o random.o x86_64-pc-linux-gnu-ld: reloc.o: warning: relocation in read-only section `.rodata' x86_64-pc-linux-gnu-ld: warning: memtest_shared has a LOAD segment with RWX permissions x86_64-pc-linux-gnu-ld: read-only segment has dynamic relocations make: *** [Makefile:24: memtest_shared] Error 1 sys-devel/binutils-2.40: x86_64-pc-linux-gnu-ld --warn-constructors --warn-common -static -T memtest_shared.lds -m elf_i386 \ -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o memsize.o error.o smp.o cpuid.o vmem.o random.o && \ x86_64-pc-linux-gnu-ld -shared -Bsymbolic -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o memsize.o error.o smp.o cpuid.o vmem.o random.o x86_64-pc-linux-gnu-ld: warning: head.o: missing .note.GNU-stack section implies executable stack x86_64-pc-linux-gnu-ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker x86_64-pc-linux-gnu-ld: warning: head.o: missing .note.GNU-stack section implies executable stack x86_64-pc-linux-gnu-ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker x86_64-pc-linux-gnu-ld: reloc.o: warning: relocation in read-only section `.rodata' x86_64-pc-linux-gnu-ld: warning: memtest_shared has a LOAD segment with RWX permissions x86_64-pc-linux-gnu-ld: warning: creating DT_TEXTREL in a shared object objcopy -O binary memtest_shared memtest_shared.bin x86_64-pc-linux-gnu-ld -T memtest.bin.lds bootsect.o setup.o -b binary \ memtest_shared.bin -o memtest.bin x86_64-pc-linux-gnu-ld -s -T memtest.lds -b binary memtest_shared.bin -o memtest This bug is a candidate of https://bugs.gentoo.org/911581 tracker bug. Reproducible: Always
Thanks. It's because of the hardened changes we made in 2.41. Can you include the full build.log w/ 2.41 and emerge --info for completeness?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=abce894dde2ad1b4babeaa1f4fc86e76e22e0c45 commit abce894dde2ad1b4babeaa1f4fc86e76e22e0c45 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-08-28 19:14:35 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-08-28 19:32:20 +0000 sys-apps/memtest86: fix build w/ binutils-2.41[hardened] Closes: https://bugs.gentoo.org/912343 Signed-off-by: Sam James <sam@gentoo.org> .../memtest86-4.3.7-binutils-2.41-textrels.patch | 31 ++++++++++++++++++++++ sys-apps/memtest86/memtest86-4.3.7-r3.ebuild | 3 ++- 2 files changed, 33 insertions(+), 1 deletion(-)