mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241587 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6b24d0a9a7
commit
8b3aaabd30
@ -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))
|
||||
|
9
test/Object/X86/nm-macho.s
Normal file
9
test/Object/X86/nm-macho.s
Normal file
@ -0,0 +1,9 @@
|
||||
// RUN: llvm-mc %s -o %t -filetype=obj -triple=x86_64-apple-darwin
|
||||
// RUN: llvm-nm -n %t | FileCheck %s
|
||||
// CHECK: 0000000000000000 t _f
|
||||
// CHECK: 0000000000000004 C _a
|
||||
|
||||
_f:
|
||||
retq
|
||||
|
||||
.comm _a,4
|
Loading…
Reference in New Issue
Block a user