diff options
Diffstat (limited to 'lld/ELF/Driver.cpp')
-rw-r--r-- | lld/ELF/Driver.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 3bb90537026..9a142284eb2 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -325,9 +325,12 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) { if (Config->EMachine == EM_MIPS) { // On MIPS O32 ABI, _gp_disp is a magic symbol designates offset between - // start of function and gp pointer into GOT. Use 'strong' variant of - // the addIgnored to prevent '_gp_disp' substitution. + // start of function and 'gp' pointer into GOT. Config->MipsGpDisp = Symtab.addIgnored("_gp_disp"); + // The __gnu_local_gp is a magic symbol equal to the current value of 'gp' + // pointer. This symbol is used in the code generated by .cpload pseudo-op + // in case of using -mno-shared option. + // https://sourceware.org/ml/binutils/2004-12/msg00094.html Config->MipsLocalGp = Symtab.addIgnored("__gnu_local_gp"); // Define _gp for MIPS. st_value of _gp symbol will be updated by Writer |