[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/24874] New: ld: --gc-sections reorders GNU build attributes
From: |
fweimer at redhat dot com |
Subject: |
[Bug ld/24874] New: ld: --gc-sections reorders GNU build attributes |
Date: |
Fri, 02 Aug 2019 16:53:33 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=24874
Bug ID: 24874
Summary: ld: --gc-sections reorders GNU build attributes
Product: binutils
Version: 2.32
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: fweimer at redhat dot com
Target Milestone: ---
On Fedora rawhide, this reproducer:
cat > t.c <<EOF
int main (void)
{
}
EOF
gcc -ffunction-sections t.c -Wl,--gc-sections
strip a.out
fails with:
strip:a.out[.gnu.build.attributes]: bad GNU build attribute notes: first note
not version note: bad value
The reason is that --gc-sections reorders the build attribute notes:
Displaying notes found in: .gnu.build.attributes
Owner Data size Description
GA$<tool>gcc 9.1.1 20190605 0x00000000 OPEN Applies to region
from 0
GA*GOW:0x452a 0x00000000 OPEN Applies to region
from 0
GA*<stack prot>off 0x00000000 OPEN Applies to region
from 0
GA+stack_clash:true 0x00000000 OPEN Applies to region
from 0
…
The expected order (at least for strip) is like this:
Displaying notes found in: .gnu.build.attributes
Owner Data size Description
GA$<version>3h877 0x00000010 OPEN Applies to region
from 0x401020 to 0x401020 (.annobin_init.c.hot)
GA$<tool>gcc 9.1.1 20190605 0x00000000 OPEN Applies to region
from 0x401020
GA*GOW:0x452a 0x00000000 OPEN Applies to region
from 0x401020
…
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/24874] New: ld: --gc-sections reorders GNU build attributes,
fweimer at redhat dot com <=