Bug 711268

Summary: --gc-sections doesn't work on note sections
Product: [Fedora] Fedora Reporter: H.J. Lu <hongjiu.lu>
Component: binutilsAssignee: Nick Clifton <nickc>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: dsmith, fche, jakub, jistone, mjw, nickc, scox, wcohen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-10 08:52:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description H.J. Lu 2011-06-07 03:17:07 UTC
When compiling GCC 4.7 on Fedora 15 with
systemtap-sdt-devel-1.4-9.fc15.x86_64, x64-64
unwind-dw2.s has

.pushsection .note.stapsdt,"?","note"
.balign 4
.4byte 992f-991f,994f-993f,3
991: .asciz "stapsdt"
992: .balign 4
993: .8byte 990b
.8byte _.stapsdt.base
.8byte 0
.asciz "libgcc"
.asciz "unwind"
.asciz "8@%rdi 8@%rsi"
994: .balign 4
.popsection

# 0 "" 2
# 1555 "/export/gnu/import/git/gcc-x32/libgcc/../gcc/unwind-dw2.c" 1
        .ifndef _.stapsdt.base
.pushsection .stapsdt.base,"aG","progbits",.stapsdt.base,comdat
.weak _.stapsdt.base
.hidden _.stapsdt.base
_.stapsdt.base: .space 1
.size _.stapsdt.base,1

It is unsafe since .stapsdt.base section may be deleted
by another .stapsdt.base section group and it leads
to undefined reference error in .note.stapsdt section.
2 sections must be put in the same section group.

Comment 1 Josh Stone 2011-06-09 18:56:32 UTC
In the upstream tracker, H.J. Lu determined that this is really an issue in ld, and committed a fix as well.

Comment 2 Nick Clifton 2011-06-10 08:52:32 UTC
I have added H.J.'s patch to the latest binutils release in rawhide: 
binutils-2.21.52.0.1-2.fc16.  cf:

http://sourceware.org/ml/binutils/2011-06/msg00107.html

Comment 3 H.J. Lu 2011-06-12 13:23:48 UTC
I released the Linux binutils 2.21.52.0.2, which contains
the fix and Intel AVX2 support.