Commit Graph

3 Commits

Author SHA1 Message Date
Simon Atanasyan d2980d3e20 [ELF][MIPS] Reduce number of redundant entries in the local part of MIPS GOT
Local symbol which requires GOT entry initialized by "page" address.
This address is high 16 bits of sum of the symbol value and the relocation
addend. In the relocation scanning phase final values of symbols are unknown
so to reduce number of allocated GOT entries do the following trick. Save
all output sections referenced by GOT relocations during the relocation
scanning phase. Then later in the `GotSection::finalize` method calculate
number of "pages" required to cover all saved output sections and allocate
appropriate number of GOT entries. We assume the worst case - each 64kb
page of the output section has at least one GOT relocation against it.

Differential Revision: http://reviews.llvm.org/D18349

llvm-svn: 264730
2016-03-29 14:07:22 +00:00
Simon Atanasyan 6dd7061d15 [ELF][MIPS] Add case demonstrates creation redundant MIPS GOT entries for non-local symbols. NFC.
llvm-svn: 263897
2016-03-20 11:53:39 +00:00
Simon Atanasyan 60d0555004 [ELF][MIPS] Add test case to check number of redundant entries in the local part of MIPS GOT. NFC.
llvm-svn: 263711
2016-03-17 12:36:00 +00:00