mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-30 00:24:00 +00:00
Put in the symbol table symbols only used in a .globl statement.
Fixes PR9292. llvm-svn: 126330
This commit is contained in:
parent
d9564589f6
commit
993a4ef35c
@ -833,7 +833,11 @@ static bool isInSymtab(const MCAssembler &Asm, const MCSymbolData &Data,
|
||||
return true;
|
||||
|
||||
const MCSymbol &A = Symbol.AliasedSymbol();
|
||||
if (!A.isVariable() && A.isUndefined() && !Data.isCommon())
|
||||
if (Symbol.isVariable() && !A.isVariable() && A.isUndefined())
|
||||
return false;
|
||||
|
||||
bool IsGlobal = GetBinding(Data) == ELF::STB_GLOBAL;
|
||||
if (!Symbol.isVariable() && Symbol.isUndefined() && !IsGlobal)
|
||||
return false;
|
||||
|
||||
if (!Asm.isSymbolLinkerVisible(Symbol) && !Symbol.isUndefined())
|
||||
|
26
test/MC/ELF/pr9292.s
Normal file
26
test/MC/ELF/pr9292.s
Normal file
@ -0,0 +1,26 @@
|
||||
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s
|
||||
|
||||
// Test that both foo and bar are undefined.
|
||||
|
||||
.globl foo
|
||||
.globl bar
|
||||
mov %eax,bar
|
||||
|
||||
|
||||
// CHECK: (('st_name', 0x00000005) # 'bar'
|
||||
// CHECK-NEXT: ('st_bind', 0x00000001)
|
||||
// CHECK-NEXT: ('st_type', 0x00000000)
|
||||
// CHECK-NEXT: ('st_other', 0x00000000)
|
||||
// CHECK-NEXT: ('st_shndx', 0x00000000)
|
||||
// CHECK-NEXT: ('st_value', 0x0000000000000000)
|
||||
// CHECK-NEXT: ('st_size', 0x0000000000000000)
|
||||
// CHECK-NEXT: ),
|
||||
// CHECK-NEXT: # Symbol 0x00000005
|
||||
// CHECK-NEXT: (('st_name', 0x00000001) # 'foo'
|
||||
// CHECK-NEXT: ('st_bind', 0x00000001)
|
||||
// CHECK-NEXT: ('st_type', 0x00000000)
|
||||
// CHECK-NEXT: ('st_other', 0x00000000)
|
||||
// CHECK-NEXT: ('st_shndx', 0x00000000)
|
||||
// CHECK-NEXT: ('st_value', 0x0000000000000000)
|
||||
// CHECK-NEXT: ('st_size', 0x0000000000000000)
|
||||
// CHECK-NEXT: ),
|
Loading…
x
Reference in New Issue
Block a user