Bug 1576362

Summary: binutils: annobin notes and discarded sections
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: binutilsAssignee: Nick Clifton <nickc>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: dvlasenk, howaboutsynergy, jakub, nickc, projects.rg
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: binutils-2.30-20.fc29 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-15 13:25:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1576363    
Description Flags
func.S none

Description Florian Weimer 2018-05-09 09:31:31 UTC
Created attachment 1433703 [details]

Steps to reproduce:

$ gcc -Wa,--generate-missing-build-notes=yes -o foo.o -DFUNC=foo -c func.S
$ gcc -Wa,--generate-missing-build-notes=yes -o bar.o -DFUNC=bar -c func.S
$ ld -r foo.o bar.o
bar.o: In function `foo':
(.text+0x0): multiple definition of `foo'
foo.o:(.text+0x0): first defined here
`.gnu.linkonce.t.__x86.get_pc_thunk.ax' referenced in section `.gnu.build.attributes' of bar.o: defined in discarded section `.gnu.linkonce.t.__x86.get_pc_thunk.ax' of bar.o

I don't see a workaround.

This happens within the glibc build after reducing the scope of -Wa,--generate-missing-build-notes=yes as far as possible.  I thought that I had enabled these notes before, but I did not, so I didn't notice the bug until now.

Seen with: binutils-2.30-18.fc29.i686

Comment 1 Nick Clifton 2018-05-14 16:38:46 UTC
I have applied a patch to the assembler to stop it generating build notes
when dealing with linkonce sections.  Not an ideal fix, since the linkonce
section that it retained will not have notes (unless they were generated by
the compiler), but at least it will allow assembly to proceed.

Fixed in: binutils-2.30-20.fc29.

Comment 2 Raphael Groner 2018-07-26 06:12:23 UTC
Not sure if bug #1605019 was a duplicate.

Comment 3 Jan Kurik 2018-08-14 11:19:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.