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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 14:24:11 PST 2016


ruiu added a comment.

Can you then add addIgnoredStrong() and IgnoredUndefStrong? The new ignored symbol is not actually specific to Mips or Mips _gp_disp symbol.


================
Comment at: test/ELF/mips-gp-disp.s:5
@@ +4,3 @@
+# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
+# RUN: ld.lld -o %t.exe %t.o %S/Inputs/mips-gp-disp-def.so
+# RUN: llvm-readobj -symbols %t.exe | FileCheck -check-prefix=EXE %s
----------------
atanasyan wrote:
> ruiu wrote:
> > Can you create this so file in this file from an assembly file, instead of checking in a binary file?
> I can't. This so file has _gp_disp in the symbol table and emulates a legacy shared library.  In fact we do not need to have _gp_disp in a symbol table and LLD cannot produce such shared library itself.
Ah, interesting, but there's still some way to create such .so file in an unusual way. For example, you can create an .so with a dummy symbol _XX_XXXX and replace it with _gp_disp using sed.


Repository:
  rL LLVM

http://reviews.llvm.org/D16084





More information about the llvm-commits mailing list