diff options
| author | Paul Semel <semelpaul@gmail.com> | 2018-06-01 16:19:46 +0000 |
|---|---|---|
| committer | Paul Semel <semelpaul@gmail.com> | 2018-06-01 16:19:46 +0000 |
| commit | 46201fb7bc31ed90409440878ccbe567efd33cd8 (patch) | |
| tree | cb0ead3bb6726309d2af8700d78e060e2dbb697a /llvm/tools/llvm-objcopy/Object.h | |
| parent | bc68385dad322f80a5b064db2f4e0fd3f9c21781 (diff) | |
| download | bcm5719-llvm-46201fb7bc31ed90409440878ccbe567efd33cd8.tar.gz bcm5719-llvm-46201fb7bc31ed90409440878ccbe567efd33cd8.zip | |
[llvm-objcopy] Fix null symbol handling
This fixes the bug where strip-all option was
leading to a malformed outputted ELF file.
Differential Revision: https://reviews.llvm.org/D47414
llvm-svn: 333772
Diffstat (limited to 'llvm/tools/llvm-objcopy/Object.h')
| -rw-r--r-- | llvm/tools/llvm-objcopy/Object.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/llvm-objcopy/Object.h b/llvm/tools/llvm-objcopy/Object.h index d005f0d4902..c7939b4a498 100644 --- a/llvm/tools/llvm-objcopy/Object.h +++ b/llvm/tools/llvm-objcopy/Object.h @@ -367,7 +367,8 @@ public: SectionBase *DefinedIn, uint64_t Value, uint8_t Visibility, uint16_t Shndx, uint64_t Sz); void addSymbolNames(); - bool empty() const { return Symbols.empty(); } + // An 'empty' symbol table still contains a null symbol. + bool empty() const { return Symbols.size() == 1; } const SectionBase *getStrTab() const { return SymbolNames; } const Symbol *getSymbolByIndex(uint32_t Index) const; Symbol *getSymbolByIndex(uint32_t Index); |

