diff options
author | Fangrui Song <maskray@google.com> | 2019-10-17 11:21:54 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-10-17 11:21:54 +0000 |
commit | 9dce25a9fa953cec1b89009226cdc463166a7ad4 (patch) | |
tree | fc4d2804f0ca64c4df7e72a2c66bede290333ec1 /lldb/packages/Python/lldbsuite/test/sample_test | |
parent | dc3957ec215dd17b8d293461f18696566637a6cd (diff) | |
download | bcm5719-llvm-9dce25a9fa953cec1b89009226cdc463166a7ad4.tar.gz bcm5719-llvm-9dce25a9fa953cec1b89009226cdc463166a7ad4.zip |
[llvm-objcopy] --add-symbol: fix crash if SHT_SYMTAB does not exist
Exposed by D69041. If SHT_SYMTAB does not exist, ELFObjcopy.cpp:handleArgs will crash due
to a null pointer dereference.
for (const NewSymbolInfo &SI : Config.ELF->SymbolsToAdd) {
...
Obj.SymbolTable->addSymbol(
Fix this by creating .symtab and .strtab on demand in ELFBuilder<ELFT>::readSections,
if --add-symbol is specified.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D69093
llvm-svn: 375105
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/sample_test')
0 files changed, 0 insertions, 0 deletions