mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-07 08:34:59 +00:00
Implement sectionContainsSymbol for ELF.
Patch by Nico Rieck! llvm-svn: 178677
This commit is contained in:
parent
d5972ea8fc
commit
8d67ab4f70
@ -1378,8 +1378,16 @@ template<class ELFT>
|
||||
error_code ELFObjectFile<ELFT>::sectionContainsSymbol(DataRefImpl Sec,
|
||||
DataRefImpl Symb,
|
||||
bool &Result) const {
|
||||
// FIXME: Unimplemented.
|
||||
Result = false;
|
||||
validateSymbol(Symb);
|
||||
|
||||
const Elf_Shdr *sec = reinterpret_cast<const Elf_Shdr *>(Sec.p);
|
||||
const Elf_Sym *symb = getSymbol(Symb);
|
||||
|
||||
unsigned shndx = symb->st_shndx;
|
||||
bool Reserved = shndx >= ELF::SHN_LORESERVE
|
||||
&& shndx <= ELF::SHN_HIRESERVE;
|
||||
|
||||
Result = !Reserved && (sec == getSection(symb->st_shndx));
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
|
@ -2,10 +2,12 @@ RUN: llvm-objdump -disassemble -triple mips64el -mattr +mips64r2 %p/../Inputs/de
|
||||
RUN: | FileCheck %s
|
||||
|
||||
CHECK: Disassembly of section .text:
|
||||
CHECK: .text:
|
||||
CHECK: dext:
|
||||
CHECK: 0: 08 00 e0 03 jr $ra
|
||||
CHECK: 4: 43 49 82 7c dext $2, $4, 5, 10
|
||||
CHECK: dextu:
|
||||
CHECK: 8: 08 00 e0 03 jr $ra
|
||||
CHECK: c: 83 28 82 7c dext $2, $4, 2, 6
|
||||
CHECK: dextm:
|
||||
CHECK: 10: 08 00 e0 03 jr $ra
|
||||
CHECK: 14: 43 09 82 7c dext $2, $4, 5, 2
|
||||
|
Loading…
Reference in New Issue
Block a user