134 lines · plain
1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t2// RUN: llvm-readobj -S %t | FileCheck --check-prefix=SECTIONS %s3// RUN: llvm-readobj --symbols %t | FileCheck --check-prefix=SYMBOLS %s4 5// Test that we create a .symtab_shndx if a symbol points to a section6// numbered SHN_LORESERVE (0xFF00) or higher.7 8// SECTIONS: Name: .symtab_shndx9 10// Test that we don't create a symbol for the symtab_shndx section.11// SYMBOLS-NOT: symtab_shndx12 13// SYMBOLS: Name: dm (0)14// SYMBOLS: Value: 0x015// SYMBOLS: Size: 016// SYMBOLS: Binding: Local (0x0)17// SYMBOLS: Type: Section (0x3)18// SYMBOLS: Other: 019// SYMBOLS: Section: dm (0xFF00)20// SYMBOLS-NEXT: }21 22// Test that both a and b show up in the correct section.23// SYMBOLS: Name: a24// SYMBOLS-NEXT: Value: 0x025// SYMBOLS-NEXT: Size: 026// SYMBOLS-NEXT: Binding: Local (0x0)27// SYMBOLS-NEXT: Type: None (0x0)28// SYMBOLS-NEXT: Other: 029// SYMBOLS-NEXT: Section: dm (0xFF00)30// SYMBOLS-NEXT: }31// SYMBOLS-NEXT: Symbol {32// SYMBOLS-NEXT: Name: b33// SYMBOLS-NEXT: Value: 0x134// SYMBOLS-NEXT: Size: 035// SYMBOLS-NEXT: Binding: Local (0x0)36// SYMBOLS-NEXT: Type: None (0x0)37// SYMBOLS-NEXT: Other: 038// SYMBOLS-NEXT: Section: dm (0xFF00)39// SYMBOLS-NEXT: }40// SYMBOLS-NEXT:]41 42.macro gen_sections4 x43 .section a\x44 .section b\x45 .section c\x46 .section d\x47.endm48 49.macro gen_sections8 x50 gen_sections4 a\x51 gen_sections4 b\x52.endm53 54.macro gen_sections16 x55 gen_sections8 a\x56 gen_sections8 b\x57.endm58 59.macro gen_sections32 x60 gen_sections16 a\x61 gen_sections16 b\x62.endm63 64.macro gen_sections64 x65 gen_sections32 a\x66 gen_sections32 b\x67.endm68 69.macro gen_sections128 x70 gen_sections64 a\x71 gen_sections64 b\x72.endm73 74.macro gen_sections256 x75 gen_sections128 a\x76 gen_sections128 b\x77.endm78 79.macro gen_sections512 x80 gen_sections256 a\x81 gen_sections256 b\x82.endm83 84.macro gen_sections1024 x85 gen_sections512 a\x86 gen_sections512 b\x87.endm88 89.macro gen_sections2048 x90 gen_sections1024 a\x91 gen_sections1024 b\x92.endm93 94.macro gen_sections4096 x95 gen_sections2048 a\x96 gen_sections2048 b\x97.endm98 99.macro gen_sections8192 x100 gen_sections4096 a\x101 gen_sections4096 b\x102.endm103 104.macro gen_sections16384 x105 gen_sections8192 a\x106 gen_sections8192 b\x107.endm108 109.macro gen_sections32768 x110 gen_sections16384 a\x111 gen_sections16384 b\x112.endm113 114 .section foo115 .section bar116 117gen_sections32768 a118gen_sections16384 b119gen_sections8192 c120gen_sections4096 d121gen_sections2048 e122gen_sections1024 f123gen_sections512 g124gen_sections128 h125gen_sections64 i126gen_sections32 j127gen_sections16 k128gen_sections8 l129gen_sections4 m130 131a:132b = a + 1133.long dm134