bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/29994] New: ld fails to generate NOTE segment (with Build ID) on


From: tom.saeger at oracle dot com
Subject: [Bug ld/29994] New: ld fails to generate NOTE segment (with Build ID) on aarch64 if -z execstack or -z noexecstack
Date: Thu, 12 Jan 2023 20:49:52 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=29994

            Bug ID: 29994
           Summary: ld fails to generate NOTE segment (with Build ID) on
                    aarch64 if -z execstack or -z noexecstack
           Product: binutils
           Version: 2.39
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: tom.saeger at oracle dot com
  Target Milestone: ---

This issue was discovered while building linux-stable 5.15.y on aarch64.
Introduced into 5.15.y by 
4c7ee827da2c ("Makefile: link with -z noexecstack --no-warn-rwx-segments")
which is a backport of
0d362be5b142 ("Makefile: link with -z noexecstack --no-warn-rwx-segments")

Discussions for context:
- https://lore.kernel.org/all/cover.1670358255.git.tom.saeger@oracle.com/#r
-
https://lore.kernel.org/all/3df32572ec7016e783d37e185f88495831671f5d.1671143628.git.tom.saeger@oracle.com/


The tool-flow within 5.15.y linux kernels, when configured with
CONFIG_MODVERSIONS is roughly:

1. gcc head.S -> head.o
2. ld -z noexecstack head.o -> .tmp_head.o
3. mv -f .tmp_head.o head.o
4. ld -o vmlinux --whole-archive arch/arm64/kernel/head.o ...

After 4c7ee827da2c, on aarch64 the resulting vmlinux does not have a NOTE
segment which contains the Build ID.
This seems unique to aarch64 and ld.
x86_64 works.
aarch64 llvm works.

If step 2 above uses -z execstack - it still fails.

However, removing -z noexecstack from step 2. in my testing works-around this
issue. 


Reproduction steps (on aarch64 system):

git clone -b v5.15.61 --depth=1
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
make ARCH=arm64 defconfig
scripts/config -e MODVERSIONS
make ARCH=arm64 olddefconfig
make ARCH=arm64 V=1 -j16 vmlinux
readelf -n vmlinux

ld versions 2.36, 2.37, 2.38, and 2.39 all exhibited this same behavior.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]