[PATCH] D35567: [Sparc] invalid adjustments in TLS_LE/TLS_LDO relocations removed

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 09:31:02 PDT 2017

jyknight added a comment.

Late LGTM. :) Comments for some future work.

Comment at: test/MC/Sparc/sparc-tls-relocations.s:32
+	! OBJDUMP: {{[0-9,a-f]+}}:  31 00 00 00  sethi 0, %i0
+	! OBJDUMP: {{[0-9,a-f]+}}:     R_SPARC_TLS_LE_HIX22 Unknown
+        ! ASM: sethi %tle_hix22(_ZL4Head), %i0 ! encoding: [0x31,0x00,0x00,0x00]
What's up with the "Unknown" here? That seems like another bug. And, wouldn't need the separate invocation of llvm-readobj if not for this.

Comment at: test/MC/Sparc/sparc-tls-relocations.s:65-66
+        ! ???error from llvm-mc on the next asm line???
+	! add %i0, %i2, %o0, %tldm_add(_ZL4Head)
fedor.sergeev wrote:
> I was going to add complete asm sequence as generated by clang, but llvm-mc issues "invalid operand" on "@tldm_add", "@tldm_call" and "@tldo_add".
> I'm not sure where the problem is, it will go on my TODO list to dig into it and at least file a bug.
> I decided to comment these lines, so the rest of relocations get tested.
It's because of isCodeGenOnly = 1 around TLS_ADDrr, TLS_LDrr, and TLS_CALL in SparcInstrInfo.td. I *think* that flag should just be deleted (leaving isAsmParserOnly = 1, because these cannot be parsed from an object file).

Fine to do in a subsequent change.



More information about the llvm-commits mailing list