[PATCH] D73228: [AsmPrinter][ELF] Define local aliases (.Lfoo$local) for GlobalObjects

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 10:30:33 PST 2020


peter.smith added a comment.

To make sure I understand, this is adding a local alias as at assembly time that can be used as a fixup target. This is necessary as at assembly time all we have is a global default visibility symbol which we have to assume can be interposed, even if the code-generator has already assumed it. Are there other uses that I'm missing?
As it stands this sounds reasonable to me, I'm trying to think if there are any other alternatives and what the trade-offs would be. For example is there no way that the assembler could find out the information at assembly time, or is that more complex than adding local aliases?



================
Comment at: llvm/test/CodeGen/AMDGPU/r600-constant-array-fixup.ll:4
 @arr = internal unnamed_addr addrspace(4) constant [4 x i32] [i32 4, i32 5, i32 6, i32 7], align 4
 
 ; CHECK: Relocations [
----------------
As I understand it, this patch should just add local aliases for some known DSO local global symbols. This looks to have changed the relocation target and the value of arr. Intuitively I wouldn't have expected this from adding the aliases alone. There must be something I'm missing either in the patch, or this could be something to do with the AMDGPU backend. I'd be grateful if you could explain the difference?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73228/new/

https://reviews.llvm.org/D73228





More information about the llvm-commits mailing list