1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

MC: Redirect .addrsig directives referring to private (.L) symbols to the section symbol.

This matches our behaviour for regular (i.e. relocated) references to
private symbols and therefore avoids needing to unnecessarily write
address-significant .L symbols to the object file's symbol table,
which can interfere with stack traces.

Fixes check-cfi after r339050.

llvm-svn: 339066
This commit is contained in:
Peter Collingbourne 2018-08-06 21:59:58 +00:00
parent 8aa52b1fc0
commit a25cd62f6b
2 changed files with 9 additions and 7 deletions

View File

@ -1273,6 +1273,8 @@ void ELFObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
for (const MCSymbol *&Sym : AddrsigSyms) {
if (const MCSymbol *R = Renames.lookup(cast<MCSymbolELF>(Sym)))
Sym = R;
if (Sym->isInSection() && Sym->getName().startswith(".L"))
Sym = Sym->getSection().getBeginSymbol();
Sym->setUsedInReloc();
}
}

View File

@ -16,29 +16,29 @@
// CHECK-NEXT: AddressAlignment: 1
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 03050201
// CHECK-NEXT: 0000: 03050102
// CHECK-NEXT: )
// CHECK-NEXT: }
// CHECK-NEXT: Section {
// CHECK-NEXT: Index: 4
// CHECK-NEXT: Name: .symtab
// CHECK: Name: .Llocal
// CHECK: Name: local
// CHECK-NEXT: Value:
// CHECK-NEXT: Size:
// CHECK-NEXT: Binding:
// CHECK-NEXT: Type:
// CHECK-NEXT: Other:
// CHECK-NEXT: Section:
// CHECK-NEXT: Section: [[SEC:.*]]
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: local
// CHECK-NEXT: Name:
// CHECK-NEXT: Value:
// CHECK-NEXT: Size:
// CHECK-NEXT: Binding:
// CHECK-NEXT: Type:
// CHECK-NEXT: Other:
// CHECK-NEXT: Section:
// CHECK-NEXT: Section: [[SEC]]
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: g1
@ -64,8 +64,8 @@
// CHECK: Addrsig [
// CHECK-NEXT: Sym: g1 (3)
// CHECK-NEXT: Sym: g3 (5)
// CHECK-NEXT: Sym: local (2)
// CHECK-NEXT: Sym: .Llocal (1)
// CHECK-NEXT: Sym: local (1)
// CHECK-NEXT: Sym: (2)
// CHECK-NEXT: ]
// ASM: .addrsig