diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2016-11-09 21:36:56 +0000 |
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2016-11-09 21:36:56 +0000 |
| commit | ce02cf0099e912e31300d58477d65ae26ea13ef8 (patch) | |
| tree | 7f8ab1d2c2ce98aee2425bc51427437b595604d1 /lld/ELF/InputFiles.cpp | |
| parent | b0e067b08dd57a510f7d2c705fbd3c68bf73aecf (diff) | |
| download | bcm5719-llvm-ce02cf0099e912e31300d58477d65ae26ea13ef8.tar.gz bcm5719-llvm-ce02cf0099e912e31300d58477d65ae26ea13ef8.zip | |
[ELF][MIPS] Convert .reginfo and .MIPS.options sections to synthetic input sections
Previously, we have both input and output sections for .reginfo and
.MIPS.options. Now for each such sections we have one synthetic input
sections: MipsReginfoSection and MipsOptionsSection respectively.
Both sections are handled as regular sections until the control reaches
Writer. Writer then aggregates all sections whose type is SHT_MIPS_REGINFO
or SHT_MIPS_OPTIONS to create a single synthesized input section. In that
moment Writer also save GP0 value to the MipsGp0 field of the corresponding
ObjectFile. This value required for R_MIPS_GPREL16 and R_MIPS_GPREL32
relocations calculation.
Differential revision: https://reviews.llvm.org/D26444
llvm-svn: 286397
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index aa44fe21d46..e7e2c5f4824 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -160,14 +160,6 @@ ArrayRef<SymbolBody *> elf::ObjectFile<ELFT>::getSymbols() { return makeArrayRef(this->SymbolBodies).slice(1); } -template <class ELFT> uint32_t elf::ObjectFile<ELFT>::getMipsGp0() const { - if (ELFT::Is64Bits && MipsOptions && MipsOptions->Reginfo) - return MipsOptions->Reginfo->ri_gp_value; - if (!ELFT::Is64Bits && MipsReginfo && MipsReginfo->Reginfo) - return MipsReginfo->Reginfo->ri_gp_value; - return 0; -} - template <class ELFT> void elf::ObjectFile<ELFT>::parse(DenseSet<CachedHashStringRef> &ComdatGroups) { // Read section and symbol tables. @@ -348,18 +340,6 @@ elf::ObjectFile<ELFT>::createInputSection(const Elf_Shdr &Sec, // FIXME: ARM meta-data section. At present attributes are ignored, // they can be used to reason about object compatibility. return &InputSection<ELFT>::Discarded; - case SHT_MIPS_REGINFO: - if (MipsReginfo) - fatal(getFilename(this) + - ": multiple SHT_MIPS_REGINFO sections are not allowed"); - MipsReginfo.reset(new MipsReginfoInputSection<ELFT>(this, &Sec, Name)); - return MipsReginfo.get(); - case SHT_MIPS_OPTIONS: - if (MipsOptions) - fatal(getFilename(this) + - ": multiple SHT_MIPS_OPTIONS sections are not allowed"); - MipsOptions.reset(new MipsOptionsInputSection<ELFT>(this, &Sec, Name)); - return MipsOptions.get(); case SHT_MIPS_ABIFLAGS: if (MipsAbiFlags) fatal(getFilename(this) + |

