Skip to content

Commit

Permalink
[MC,AArch64] Remove unneeded STT_NOTYPE/STB_LOCAL code for mapping sy…
Browse files Browse the repository at this point in the history
…mbols and improve tests
  • Loading branch information
MaskRay committed Aug 17, 2024
1 parent cd3f48d commit 8d8f56d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 0 additions & 2 deletions llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,6 @@ class AArch64ELFStreamer : public MCELFStreamer {
void emitMappingSymbol(StringRef Name) {
auto *Symbol = cast<MCSymbolELF>(getContext().createLocalSymbol(Name));
emitLabel(Symbol);
Symbol->setType(ELF::STT_NOTYPE);
Symbol->setBinding(ELF::STB_LOCAL);
}

DenseMap<const MCSection *, ElfMappingSymbol> LastMappingSymbols;
Expand Down
17 changes: 10 additions & 7 deletions llvm/test/MC/AArch64/mapping-within-section.s
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: llvm-mc -triple=aarch64-none-linux-gnu -filetype=obj %s | llvm-nm --no-sort --special-syms - | FileCheck %s --match-full-lines
# RUN: llvm-mc -triple=aarch64-none-linux-gnu -filetype=obj %s -o %t
# RUN: llvm-readelf -Ss %t | FileCheck %s

.text
// $x at 0x0000
Expand All @@ -22,9 +23,11 @@
$d:
$x:

// CHECK: 0000000000000000 t $x
// CHECK-NEXT: 0000000000000004 t $d
// CHECK-NEXT: 0000000000000064 t $x
// CHECK-NEXT: 0000000000000068 t $x
// CHECK-NEXT: 0000000000000068 T $d
// CHECK-NOT: {{.}}
# CHECK: [[#TEXT:]]] .text

# CHECK: 1: 0000000000000000 0 NOTYPE LOCAL DEFAULT [[#TEXT]] $x
# CHECK-NEXT: 2: 0000000000000004 0 NOTYPE LOCAL DEFAULT [[#TEXT]] $d
# CHECK-NEXT: 3: 0000000000000064 0 NOTYPE LOCAL DEFAULT [[#TEXT]] $x
# CHECK-NEXT: 4: 0000000000000068 0 NOTYPE LOCAL DEFAULT [[#TEXT]] $x
# CHECK-NEXT: 5: 0000000000000068 0 NOTYPE GLOBAL DEFAULT [[#TEXT]] $d
# CHECK-NOT: {{.}}

0 comments on commit 8d8f56d

Please sign in to comment.