diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-07-07 14:26:39 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-07-07 14:26:39 +0000 |
commit | d82477278b0c937c73d6e8dae7e324dcc7ba9814 (patch) | |
tree | 6f0004353bbc20c4cc95fb1e02514585506e701a /llvm/lib/Object/MachOObjectFile.cpp | |
parent | c5638f915bd51f7c009fc76e37f09b9b8f618204 (diff) | |
download | bcm5719-llvm-d82477278b0c937c73d6e8dae7e324dcc7ba9814.tar.gz bcm5719-llvm-d82477278b0c937c73d6e8dae7e324dcc7ba9814.zip |
Common symbols are not undefined, at least for ObjectFile.
They are implemented like that in some object formats, but for the interface
provided by lib/Object, SF_Undefined and SF_Common are different things.
This matches the ELF and COFF implementation and fixes llvm-nm for MachO.
llvm-svn: 241587
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index ce565313455..54e4624af13 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -418,9 +418,6 @@ uint32_t MachOObjectFile::getSymbolFlags(DataRefImpl DRI) const { uint32_t Result = SymbolRef::SF_None; - if ((MachOType & MachO::N_TYPE) == MachO::N_UNDF) - Result |= SymbolRef::SF_Undefined; - if ((MachOType & MachO::N_TYPE) == MachO::N_INDR) Result |= SymbolRef::SF_Indirect; @@ -432,6 +429,8 @@ uint32_t MachOObjectFile::getSymbolFlags(DataRefImpl DRI) const { if ((MachOType & MachO::N_TYPE) == MachO::N_UNDF) { if (getNValue(DRI)) Result |= SymbolRef::SF_Common; + else + Result |= SymbolRef::SF_Undefined; } if (!(MachOType & MachO::N_PEXT)) |