diff options
| author | Fangrui Song <i@maskray.me> | 2021-12-14 16:28:41 -0800 |
|---|---|---|
| committer | Fangrui Song <i@maskray.me> | 2021-12-14 16:28:41 -0800 |
| commit | cf783be8d7a8594ab82f8215671dddbebcae39ec (patch) | |
| tree | af86cb14a723792302f32983964501d4b7ad700e /lld/ELF/MapFile.cpp | |
| parent | 04cf411c9411d56ee47b7e8419845d557c5d6549 (diff) | |
Reland D114783/D115603 [ELF] Split scanRelocations into scanRelocations/postScanRelocations
(Fixed an issue about GOT on a copy relocated alias.)
(Fixed an issue about not creating r_addend=0 IRELATIVE for unreferenced non-preemptible ifunc.)
The idea is to make scanRelocations mark some actions are needed (GOT/PLT/etc)
and postpone the real work to postScanRelocations. It gives some flexibility:
* Make it feasible to support .plt.got (PR32938): we need to know whether GLOB_DAT and JUMP_SLOT are both needed.
* Make non-preemptible IFUNC handling slightly cleaner: avoid setting/clearing sym.gotInIgot
* -z nocopyrel: report all copy relocation places for one symbol
* Make GOT deduplication feasible
* Make parallel relocation scanning feasible (if we can avoid all stateful operations and make Symbol attributes atomic), but parallelism may not be the appealing choice
Since this patch moves a large chunk of code out of ELFT templates. My x86-64
executable is actually a few hundred bytes smaller.
For ppc32-ifunc-nonpreemptible-pic.s: I remove absolute relocation references to non-preemptible ifunc
because absolute relocation references are incorrect in -fpie mode.
Reviewed By: peter.smith, ikudrin
Differential Revision: https://reviews.llvm.org/D114783
Diffstat (limited to 'lld/ELF/MapFile.cpp')
| -rw-r--r-- | lld/ELF/MapFile.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp index b898dfda8a79..275983527538 100644 --- a/lld/ELF/MapFile.cpp +++ b/lld/ELF/MapFile.cpp @@ -58,7 +58,7 @@ static std::vector<Defined *> getSymbols() { for (Symbol *b : file->getSymbols()) if (auto *dr = dyn_cast<Defined>(b)) if (!dr->isSection() && dr->section && dr->section->isLive() && - (dr->file == file || dr->needsPltAddr || dr->section->bss)) + (dr->file == file || dr->needsCopy || dr->section->bss)) v.push_back(dr); return v; } |
