mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-18 08:49:55 +00:00
Fix handling of files without a symbol table.
This fixes a recent regression (r183338). Stripped elf files (like installed crtn.o for example), are not required to have a symbol table. Handle that correctly. llvm-svn: 183573
This commit is contained in:
parent
999dacc55b
commit
a0af48fc93
@ -279,7 +279,11 @@ public:
|
||||
llvm::object::symbol_iterator it(_objFile->begin_symbols());
|
||||
llvm::object::symbol_iterator ie(_objFile->end_symbols());
|
||||
|
||||
for (it.increment(EC); it != ie; it.increment(EC)) {
|
||||
// Skip ELF's first dummy symbol if we have one.
|
||||
if (it != ie)
|
||||
it.increment(EC);
|
||||
|
||||
for (; it != ie; it.increment(EC)) {
|
||||
if (EC)
|
||||
return true;
|
||||
|
||||
|
BIN
lld/test/elf/Inputs/stripped-empty.x86_64
Normal file
BIN
lld/test/elf/Inputs/stripped-empty.x86_64
Normal file
Binary file not shown.
3
lld/test/elf/stripped-empty.test
Normal file
3
lld/test/elf/stripped-empty.test
Normal file
@ -0,0 +1,3 @@
|
||||
RUN: lld -flavor gnu -shared -o test.so %p/Inputs/stripped-empty.x86_64
|
||||
|
||||
test that we handle files without a symbol table.
|
Loading…
x
Reference in New Issue
Block a user