1# Test that cpu/processor-specific SHF_* flags are preserved. 2 3# ===== x86_64 ===== 4 5# RUN: yaml2obj --docnum=1 %s -o %t-x86_64.o 6# RUN: llvm-objcopy --rename-section=.foo=.bar,alloc %t-x86_64.o 7# RUN: llvm-readobj --sections %t-x86_64.o | FileCheck %s --check-prefix=X86_64 8 9--- !ELF 10FileHeader: 11 Class: ELFCLASS64 12 Data: ELFDATA2LSB 13 Type: ET_REL 14 Machine: EM_X86_64 15Sections: 16 - Name: .foo 17 Type: SHT_PROGBITS 18 Flags: [ SHF_X86_64_LARGE ] 19 20# X86_64: Name: .bar 21# X86_64-NEXT: Type: SHT_PROGBITS 22# X86_64-NEXT: Flags [ 23# X86_64-NEXT: SHF_ALLOC (0x2) 24# X86_64-NEXT: SHF_WRITE (0x1) 25# X86_64-NEXT: SHF_X86_64_LARGE (0x10000000) 26# X86_64-NEXT: ] 27 28# ===== hex ===== 29 30# RUN: yaml2obj --docnum=2 %s -o %t-hex.o 31# RUN: llvm-objcopy --rename-section=.foo=.bar,alloc %t-hex.o 32# RUN: llvm-readobj --sections %t-hex.o | FileCheck %s --check-prefix=HEX 33 34--- !ELF 35FileHeader: 36 Class: ELFCLASS64 37 Data: ELFDATA2LSB 38 Type: ET_REL 39 Machine: EM_HEXAGON 40Sections: 41 - Name: .foo 42 Type: SHT_PROGBITS 43 Flags: [ SHF_HEX_GPREL ] 44 45# HEX: Name: .bar 46# HEX-NEXT: Type: SHT_PROGBITS 47# HEX-NEXT: Flags [ 48# HEX-NEXT: SHF_ALLOC (0x2) 49# HEX-NEXT: SHF_HEX_GPREL (0x10000000) 50# HEX-NEXT: SHF_WRITE (0x1) 51# HEX-NEXT: ] 52 53# ===== mips ===== 54 55# RUN: yaml2obj --docnum=3 %s -o %t-mips.o 56# RUN: llvm-objcopy --rename-section=.foo=.bar,alloc %t-mips.o 57# RUN: llvm-readobj --sections %t-mips.o | FileCheck %s --check-prefix=MIPS 58 59--- !ELF 60FileHeader: 61 Class: ELFCLASS64 62 Data: ELFDATA2LSB 63 Type: ET_REL 64 Machine: EM_MIPS 65Sections: 66 - Name: .foo 67 Type: SHT_PROGBITS 68 Flags: [ SHF_MIPS_NODUPES, SHF_MIPS_NAMES, SHF_MIPS_LOCAL, 69 SHF_MIPS_NOSTRIP, SHF_MIPS_GPREL, SHF_MIPS_MERGE, 70 SHF_MIPS_ADDR, SHF_MIPS_STRING ] 71 72# Note: llvm-readobj prints SHF_EXCLUDE/SHF_MASKPROC since specifying all 73# SHF_MIPS_* flags covers the same bitset. 74 75# MIPS: Name: .bar 76# MIPS-NEXT: Type: SHT_PROGBITS 77# MIPS-NEXT: Flags [ 78# MIPS-NEXT: SHF_ALLOC (0x2) 79# MIPS-NEXT: SHF_MIPS_ADDR (0x40000000) 80# MIPS-NEXT: SHF_MIPS_GPREL (0x10000000) 81# MIPS-NEXT: SHF_MIPS_LOCAL (0x4000000) 82# MIPS-NEXT: SHF_MIPS_MERGE (0x20000000) 83# MIPS-NEXT: SHF_MIPS_NAMES (0x2000000) 84# MIPS-NEXT: SHF_MIPS_NODUPES (0x1000000) 85# MIPS-NEXT: SHF_MIPS_NOSTRIP (0x8000000) 86# MIPS-NEXT: SHF_WRITE (0x1) 87# MIPS-NEXT: ] 88 89# ===== arm ===== 90 91# RUN: yaml2obj --docnum=4 %s -o %t-arm.o 92# RUN: llvm-objcopy --rename-section=.foo=.bar,alloc %t-arm.o 93# RUN: llvm-readobj --sections %t-arm.o | FileCheck %s --check-prefix=ARM 94 95--- !ELF 96FileHeader: 97 Class: ELFCLASS64 98 Data: ELFDATA2LSB 99 Type: ET_REL 100 Machine: EM_ARM 101Sections: 102 - Name: .foo 103 Type: SHT_PROGBITS 104 Flags: [ SHF_ARM_PURECODE ] 105 106# ARM: Name: .bar 107# ARM-NEXT: Type: SHT_PROGBITS 108# ARM-NEXT: Flags [ 109# ARM-NEXT: SHF_ALLOC (0x2) 110# ARM-NEXT: SHF_ARM_PURECODE (0x20000000) 111# ARM-NEXT: SHF_WRITE (0x1) 112# ARM-NEXT: ] 113