Created attachment 1404776 [details] ifuncmod8.os Linking the attached file with “ld -shared ifuncmod8.os” produces this error: ld: BFD version 2.30-7.fc29 internal error, aborting at elf64-x86-64.c:2509 in elf_x86_64_relocate_section Furthermore, a corrupted a.out file is left behind (which will confuse make-based build systems). Among other things, eu-elflint says about the object file: section [ 6] '.rela.gnu.build.attributes': invalid destination section type section [23] '.symtab': symbol 23: unknown type If the object file itself is corrupt, I can provide the assembler input file for it. (Again, this is from an attempt to enable annobin annotations in glibc.)
Hi Florian, The problem happens because the ifuncmod8.os file contains relocs against the .gnu.build.attributes section, and this section does not have the ALLOC attribute. When creating a shared object the linker only creates dynamic relocs for allocatable sections, and barfs when it encounters anything else. I will fix the linker to generate a more helpful error message, rather than aborting. I wonder however if it should just silently ignore relocs against note sections - as it already does for relocs against debug sections. I do not know why eu-elflint is complaining about the relocations. Perhaps it thinks that relocations against note sections are illegal. They should not be illegal (at least for static objects). Cheers Nick
(In reply to Nick Clifton from comment #1) > Hi Florian, > > The problem happens because the ifuncmod8.os file contains relocs against > the .gnu.build.attributes section, and this section does not have the ALLOC > attribute. When creating a shared object the linker only creates dynamic > relocs for allocatable sections, and barfs when it encounters anything > else. Thanks for the explanation. The relocations are: Relocation section '.rela.gnu.build.attributes' at offset 0xdf8 contains 4 entries: Offset Info Type Sym. Value Sym. Name + Addend 000000000014 000200000001 R_X86_64_64 0000000000000000 .text + 0 00000000001c 000200000001 R_X86_64_64 0000000000000000 .text + 20 000000000164 001700000001 R_X86_64_64 foo() foo + 0 00000000016c 000200000001 R_X86_64_64 0000000000000000 .text + 20 I think for correctness of the annobin annotations, ld has to resolve these relocations, otherwise we cannot use the per-function notes for analysis later (because we previously agreed that there should not be relocations against those notes after the final static link).
Reported upstream as: https://sourceware.org/bugzilla/show_bug.cgi?id=22929
Created attachment 1404855 [details] ifuncmod8.s Corresponding assembler input file.
Hi Florian, H.J.Lu has come up with a patch that addresses this problem. I have applied a variation on the patch to the rawhide binutils, so please could you try: binutils-2.30-10.fc29 and let me know if there any problems. Cheers Nick
Thanks, I built glibc locally using binutils-2.30-10.fc29 on x86-64, and both test suite results and further builds using the new glibc look good. I will risk putting this into rawhide tomorrow.
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle. Changing version to '29'.
This message is a reminder that Fedora 29 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '29'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 29 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.