diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-07-07 17:12:59 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-07-07 17:12:59 +0000 |
commit | be8b0ea8542a652207c46fdf9ed412729d248c83 (patch) | |
tree | a0ec2fa57294540cbe410a6998a6f9e1e6435be2 /llvm/tools/llvm-objdump/MachODump.cpp | |
parent | 76413ecb607d71b800288c8114550d1e90cb0608 (diff) | |
download | bcm5719-llvm-be8b0ea8542a652207c46fdf9ed412729d248c83.tar.gz bcm5719-llvm-be8b0ea8542a652207c46fdf9ed412729d248c83.zip |
Delete UnknownAddress. It is a perfectly valid symbol value.
getSymbolValue now returns a value that in convenient for most callers:
* 0 for undefined
* symbol size for common symbols
* offset/address for symbols the rest
Code that needs something more specific can check getSymbolFlags.
llvm-svn: 241605
Diffstat (limited to 'llvm/tools/llvm-objdump/MachODump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/MachODump.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index fa5906bb239..239afaf31d4 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -2413,7 +2413,7 @@ static const char *get_pointer_32(uint32_t Address, uint32_t &offset, // symbol is passed, look up that address in the info's AddrMap. static const char *get_symbol_64(uint32_t sect_offset, SectionRef S, DisassembleInfo *info, uint64_t &n_value, - uint64_t ReferenceValue = UnknownAddress) { + uint64_t ReferenceValue = 0) { n_value = 0; if (!info->verbose) return nullptr; @@ -2446,8 +2446,6 @@ static const char *get_symbol_64(uint32_t sect_offset, SectionRef S, const char *SymbolName = nullptr; if (reloc_found && isExtern) { n_value = Symbol.getValue(); - if (n_value == UnknownAddress) - n_value = 0; ErrorOr<StringRef> NameOrError = Symbol.getName(); if (std::error_code EC = NameOrError.getError()) report_fatal_error(EC.message()); @@ -2469,8 +2467,7 @@ static const char *get_symbol_64(uint32_t sect_offset, SectionRef S, // We did not find an external relocation entry so look up the ReferenceValue // as an address of a symbol and if found return that symbol's name. - if (ReferenceValue != UnknownAddress) - SymbolName = GuessSymbolName(ReferenceValue, info->AddrMap); + SymbolName = GuessSymbolName(ReferenceValue, info->AddrMap); return SymbolName; } |