Some SPARC TLS relocations were applying nontrivial adjustments
to zero value, leading to unexpected non-zero values in ELF and then
Solaris linker failures.
Getting rid of these adjustments.
Fixes PR33825.
Differential D35567
[Sparc] invalid adjustments in TLS_LE/TLS_LDO relocations removed fedor.sergeev on Jul 18 2017, 8:40 AM. Authored by
Details
Some SPARC TLS relocations were applying nontrivial adjustments Getting rid of these adjustments. Fixes PR33825.
Diff Detail Event TimelineComment Actions With this change on top of trunk I'm able to manually bootstrap LLVM with clang on SPARC Solaris. Comment Actions Seems probably correct -- Value should always be zero, because ELFObjectWriter.cpp sets Value to 0 and moves the offset into the relocation if hasRelocationAddend() is true, which it is on sparc. But, yea...it would be really neat if there were tests for the TLS fixups/relocations in llvm/test/MC/Sparc. Comment Actions Initially I thought to add something to test/MC/Sparc/sparc-relocations.s but then I realized that "llvm-readobj -r" used there to dump relocations Can you recommend what tool would be appropriate to check Value of relocations for .o? Any other ways to test this except dumping .o? Comment Actions Went through test/MC/AArch64/tls-reloc.s, llvm-mc -show-encoding used there does not work for my purpose either. sethi %tle_hix22(_ZL14StackTraceHead), %i0 ! encoding: [0x31,0x00,0x00,0x00] ! fixup A - offset: 0, value: %tle_hix22(_ZL14StackTraceHead), kind: fixup_sparc_tls_le_hix22 Comment Actions Finally I found a way to dump object file so value adjustments are visible - llvm-objdump -d works just fine. Comment Actions Adding a test for all the affected relocations.
Comment Actions Late LGTM. :) Comments for some future work.
|