Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1552056 - binutils: abort at elf64-x86-64.c:2509 in elf_x86_64_relocate_section with annobin section
Summary: binutils: abort at elf64-x86-64.c:2509 in elf_x86_64_relocate_section with an...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL: https://sourceware.org/bugzilla/show_...
Whiteboard:
Depends On:
Blocks: 1548438
TreeView+ depends on / blocked
 
Reported: 2018-03-06 12:19 UTC by Florian Weimer
Modified: 2019-11-27 22:47 UTC (History)
4 users (show)

Fixed In Version: binutils-2.30-10.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-27 22:47:26 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
ifuncmod8.os (6.84 KB, application/octet-stream)
2018-03-06 12:19 UTC, Florian Weimer
no flags Details
ifuncmod8.s (17.19 KB, text/plain)
2018-03-06 14:44 UTC, Florian Weimer
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1596823 0 unspecified CLOSED binutils: internal ld error at elf64-x86-64.c:4354 in elf_x86_64_relocate_section 2022-05-16 11:32:56 UTC

Internal Links: 1596823

Description Florian Weimer 2018-03-06 12:19:17 UTC
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.)

Comment 1 Nick Clifton 2018-03-06 12:43:00 UTC
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

Comment 2 Florian Weimer 2018-03-06 12:52:24 UTC
(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).

Comment 3 Nick Clifton 2018-03-06 13:36:53 UTC
Reported upstream as:

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

Comment 4 Florian Weimer 2018-03-06 14:44:22 UTC
Created attachment 1404855 [details]
ifuncmod8.s

Corresponding assembler input file.

Comment 5 Nick Clifton 2018-03-07 15:32:28 UTC
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

Comment 6 Florian Weimer 2018-03-07 19:50:04 UTC
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.

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

Comment 8 Ben Cotton 2019-10-31 19:09:55 UTC
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.

Comment 9 Ben Cotton 2019-11-27 22:47:26 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.