diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2016-07-26 21:11:26 +0000 |
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2016-07-26 21:11:26 +0000 |
| commit | 72170d27534c54b003d5cf589dc8445b846fa146 (patch) | |
| tree | 44dd86685f5a22623d99225f316ca24b01e79fb1 | |
| parent | 77a9c7949d6243ce79c8689cc0a068b5bc5dc309 (diff) | |
| download | bcm5719-llvm-72170d27534c54b003d5cf589dc8445b846fa146.tar.gz bcm5719-llvm-72170d27534c54b003d5cf589dc8445b846fa146.zip | |
[ELF][MIPS] Use section type to recognize .reginfo and .MIPS.options sections
It is faster and more correct method than string comparision.
llvm-svn: 276807
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 57e55639593..18ed3fc4947 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -301,11 +301,11 @@ elf::ObjectFile<ELFT>::createInputSection(const Elf_Shdr &Sec) { // A MIPS object file has a special sections that contain register // usage info, which need to be handled by the linker specially. if (Config->EMachine == EM_MIPS) { - if (Name == ".reginfo") { + switch (Sec.sh_type) { + case SHT_MIPS_REGINFO: MipsReginfo.reset(new MipsReginfoInputSection<ELFT>(this, &Sec)); return MipsReginfo.get(); - } - if (Name == ".MIPS.options") { + case SHT_MIPS_OPTIONS: MipsOptions.reset(new MipsOptionsInputSection<ELFT>(this, &Sec)); return MipsOptions.get(); } |

