[PATCH] D66563: [MachO][TLOF] Use hasLocalLinkage to determine if indirect symbol is local

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 15:39:47 PDT 2019


thegameg created this revision.
thegameg added reviewers: pete, mtrent.
Herald added subscribers: hiraditya, javed.absar.
Herald added a project: LLVM.

Local symbols in the indirect symbol table contain the value `INDIRECT_SYMBOL_LOCAL` and the corresponding __pointers entry must contain the address of the target.

In r349060, I added support for local symbols in the indirect symbol table, which was checking if the symbol `isDefined` && `!isExternal` to determine if the symbol is local or not.

It turns out that `isDefined` will return false if the user of the symbol comes before its definition, and we'll again generate .long 0 which will be the symbol at the adress 0x0.

Instead of doing that, use GlobalValue::hasLocalLinkage() to check if the symbol is local.


https://reviews.llvm.org/D66563

Files:
  llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
  llvm/include/llvm/Target/TargetLoweringObjectFile.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp
  llvm/lib/Target/AArch64/AArch64TargetObjectFile.h
  llvm/lib/Target/X86/X86TargetObjectFile.cpp
  llvm/lib/Target/X86/X86TargetObjectFile.h
  llvm/test/MC/MachO/cstexpr-gotpcrel-32.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66563.216503.patch
Type: text/x-patch
Size: 8862 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190821/eef92b13/attachment.bin>


More information about the llvm-commits mailing list