mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-17 05:24:49 +00:00
[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
This commit is contained in:
parent
77a9c7949d
commit
72170d2753
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user