Bug 12896 – ld.gold complains about bad relocations when building libphobos2.so

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-06-12T03:54:00Z
Last change time
2014-08-22T08:04:07Z
Keywords
pull
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2014-06-12T03:54:19Z
The error message looks like this. generated/linux/release/64/libphobos2.so.0.66.o(.text.d_dso_init+0x38): error: reloc has bad offset 56 generated/linux/release/64/libphobos2.so.0.66.o(.text.d_dso_init+0x38): error: reloc has bad offset 56 This looks like a problem with the recently added R_ARCH_NONE relocations that were emitted to .text.d_dso_init to fix bug 4758 (--gc-section).
Comment #1 by bugzilla — 2014-06-19T18:20:42Z
Does that mean that: https://github.com/D-Programming-Language/dmd/commit/928d92fa1622165b735915078e7e2db74f1c3608 causes this problem? If so, can we revert it until a better solution is found?
Comment #2 by code — 2014-07-04T18:47:22Z
The ld.gold linker is complaining about a bad offset for the fake relocations added to pin the deh_eh and the minfo section. Those are 0-sized NONE relocations added to the end of the d_dso_init function. The gold linker complains, because it thinks there is no space for the relocation (the section only has 56 bytes) even though it doesn't require any space. A simple solution would be to set the relocation offset to 0 (i.e. the begin of d_dso_init) but there are further issues with --gc-sections and ld.gold which necessitate a different solution, so reverting is the best option for now. https://github.com/D-Programming-Language/dmd/pull/3715
Comment #3 by github-bugzilla — 2014-07-04T21:54:06Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/bcf55ca980d365fbc335bc527578b81903bde215 Merge pull request #3715 from MartinNowak/fix12896 fix Issue 12896 - ld.gold complains about bad relocations when building libphobos2.so
Comment #4 by github-bugzilla — 2014-07-08T01:25:04Z
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/b60d964fbe501f4530cf1f4cbd3b587bd24dbaa2 Merge pull request #3715 from MartinNowak/fix12896 fix Issue 12896 - ld.gold complains about bad relocations when building libphobos2.so
Comment #5 by github-bugzilla — 2014-08-22T08:04:07Z