[PATCH] D16084: [ELF][MIPS] Prevent substitution of _gp_disp symbol

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 13:53:56 PST 2016


atanasyan created this revision.
atanasyan added reviewers: ruiu, rafael.
atanasyan added a subscriber: llvm-commits.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a project: lld.

On MIPS O32 ABI, _gp_disp is a magic symbol designates offset between start of function and gp pointer into GOT. In this patch this symbol is defined as a regular absolute symbol to force the linker to always prefer this symbol and does not substitute it by symbols which might be defined in a legacy input shared library.

The `addIgnored` is not enough here because this call adds a weak symbol which might be substituted by symbol from shared library.

Repository:
  rL LLVM

http://reviews.llvm.org/D16084

Files:
  ELF/Driver.cpp
  ELF/Symbols.cpp
  ELF/Symbols.h
  ELF/Writer.cpp
  test/ELF/Inputs/mips-gp-disp-def.so
  test/ELF/mips-gp-disp.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16084.44548.patch
Type: text/x-patch
Size: 3875 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160111/a71a0150/attachment.bin>


More information about the llvm-commits mailing list