[PATCH] D16324: [ELF][MIPS] Initial support of MIPS local GOT entries
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 19 12:52:59 PST 2016
ruiu added inline comments.
================
Comment at: ELF/OutputSections.cpp:125
@@ +124,3 @@
+GotSection<ELFT>::getMipsLocalPageAddr(uintX_t EntryValue) {
+ return getMipsLocalEntryAddr((EntryValue + 0x8000) & ~0xffff);
+}
----------------
What is 0x8000?
================
Comment at: ELF/OutputSections.cpp:154-156
@@ -127,4 +153,5 @@
template <class ELFT> void GotSection<ELFT>::finalize() {
this->Header.sh_size =
- (Target->getGotHeaderEntriesNum() + Entries.size()) * sizeof(uintX_t);
+ (Target->getGotHeaderEntriesNum() + MipsLocalEntries + Entries.size()) *
+ sizeof(uintX_t);
}
----------------
This code seems a bit tricky, and I also don't like the idea to look up a table for MIPS local symbols.
How about this? We don't need to assign an index in the GOT to Sym->GotIndex() in addEntry. Instead, we can do that in GotSection::finalize(). We can also change addMipsLocalEntry(SymbolBody *) to just add a given SymbolBody to some vector (say, MipsEntries). In finalize(). we assign GotIndex to all symbols in MipsEntries first and then to all symbols in Entries.
Repository:
rL LLVM
http://reviews.llvm.org/D16324
More information about the llvm-commits
mailing list