1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/test/MC/ELF/section-sym2.s
Rafael Espindola 72efd837bc Fix the interpretation of a 0 st_name.
The ELF spec is very clear:

-----------------------------------------------------------------------------
If the value is non-zero, it represents a string table index that gives the
symbol name. Otherwise, the symbol table entry has no name.
--------------------------------------------------------------------------

In particular, a st_name of 0 most certainly doesn't mean that the symbol has
the same name as the section.

llvm-svn: 238899
2015-06-03 05:14:22 +00:00

25 lines
608 B
ArmAsm

// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -t -r --expand-relocs | FileCheck %s
// Test that we can forward reference a section.
mov .rodata, %rsi
.section .rodata
// CHECK:Relocations [
// CHECK: Section {{.*}} .rela.text {
// CHECK: Relocation {
// CHECK: Offset: 0x4
// CHECK: Type: R_X86_64_32S (11)
// CHECK: Symbol: .rodata
// CHECK: Addend: 0x0
// CHECK: }
// CHECK: }
// CHECK:]
// There is only one .rodata symbol
// CHECK:Symbols [
// CHECK: Type: Section (0x3)
// CHECK: Section: .rodata
// CHECK-NOT: Section: .rodata