<div dir="ltr">Yes, this is the only place where we were using Target while reading input files.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 29, 2019 at 2:09 AM George Rimar <<a href="mailto:grimar@accesssoftek.com" target="_blank">grimar@accesssoftek.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Were changes in 'elf::addReservedSymbols()' intentional?<br>
(I am not sure they are NFC from the context and they do not seem to be relative with the patch topic).<br>
<br>
@@ -214,17 +214,24 @@ void elf::addReservedSymbols() {<br>
// the .got section.<br>
// We do not allow _GLOBAL_OFFSET_TABLE_ to be defined by input objects as the<br>
// correctness of some relocations depends on its value.<br>
- StringRef GotTableSymName =<br>
+ StringRef GotSymName =<br>
(Config->EMachine == EM_PPC64) ? ".TOC." : "_GLOBAL_OFFSET_TABLE_";<br>
- if (Symbol *S = Symtab->find(GotTableSymName)) {<br>
- if (S->isDefined())<br>
+<br>
+ if (Symbol *S = Symtab->find(GotSymName)) {<br>
+ if (S->isDefined()) {<br>
error(toString(S->File) + " cannot redefine linker defined symbol '" +<br>
- GotTableSymName + "'");<br>
- else<br>
- ElfSym::GlobalOffsetTable = Symtab->addDefined(<br>
- GotTableSymName, STV_HIDDEN, STT_NOTYPE, Target->GotBaseSymOff,<br>
- /*Size=*/0, STB_GLOBAL, Out::ElfHeader,<br>
- /*File=*/nullptr);<br>
+ GotSymName + "'");<br>
+ return;<br>
+ }<br>
+<br>
+ uint64_t GotOff = 0;<br>
+ if (Config->EMachine == EM_PPC || Config->EMachine == EM_PPC64)<br>
+ GotOff = 0x8000;<br>
+<br>
+ ElfSym::GlobalOffsetTable =<br>
+ Symtab->addDefined(GotSymName, STV_HIDDEN, STT_NOTYPE, GotOff,<br>
+ /*Size=*/0, STB_GLOBAL, Out::ElfHeader,<br>
+ /*File=*/nullptr);<br>
}<br>
<br>
<br>
Best regards,<br>
George | Developer | Access Softek, Inc<br>
<br>
<br>
</blockquote></div>