2013-04-03 11:13:19 +08:00
|
|
|
// Test the bits of .eh_frame on mips that are already implemented correctly.
|
2013-04-02 05:55:15 +08:00
|
|
|
|
2018-12-12 15:03:04 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips-unknown-linux-gnu
|
2020-01-12 18:55:15 +08:00
|
|
|
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS32 %s
|
|
|
|
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF32,DWARF32_ABS %s
|
2013-04-02 05:55:15 +08:00
|
|
|
|
2018-12-12 15:03:04 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mipsel-unknown-linux-gnu
|
2020-01-12 18:55:15 +08:00
|
|
|
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS32 %s
|
|
|
|
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF32,DWARF32_ABS %s
|
2013-04-02 05:55:15 +08:00
|
|
|
|
2018-12-12 15:03:04 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64-unknown-linux-gnu
|
2020-01-12 18:55:15 +08:00
|
|
|
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS64 %s
|
|
|
|
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_ABS %s
|
2013-04-02 05:55:15 +08:00
|
|
|
|
2018-12-12 15:03:04 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64el-unknown-linux-gnu
|
2020-01-12 18:55:15 +08:00
|
|
|
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS64 %s
|
|
|
|
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_ABS %s
|
|
|
|
|
|
|
|
/// Check that position-indenpendent code use PC-relative relocations:
|
|
|
|
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips-unknown-linux-gnu --position-independent
|
|
|
|
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,PIC32 %s
|
|
|
|
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF32,DWARF32_PIC %s
|
|
|
|
|
|
|
|
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mipsel-unknown-linux-gnu --position-independent
|
|
|
|
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,PIC32 %s
|
|
|
|
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF32,DWARF32_PIC %s
|
|
|
|
|
|
|
|
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64-unknown-linux-gnu --position-independent
|
|
|
|
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,PIC64 %s
|
|
|
|
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_PIC %s
|
|
|
|
|
|
|
|
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64el-unknown-linux-gnu --position-independent
|
|
|
|
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,PIC64 %s
|
|
|
|
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_PIC %s
|
|
|
|
|
|
|
|
/// However using the large code model forces R_MIPS_64 since there is no R_MIPS_PC64 relocation:
|
|
|
|
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64-unknown-linux-gnu --position-independent --large-code-model
|
|
|
|
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS64 %s
|
|
|
|
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_ABS %s
|
|
|
|
|
|
|
|
// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64el-unknown-linux-gnu --position-independent --large-code-model
|
|
|
|
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS64 %s
|
|
|
|
// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_ABS %s
|
2013-04-02 05:55:15 +08:00
|
|
|
|
2013-04-03 11:13:19 +08:00
|
|
|
func:
|
|
|
|
.cfi_startproc
|
|
|
|
.cfi_endproc
|
2013-04-02 05:55:15 +08:00
|
|
|
|
2020-01-12 18:55:15 +08:00
|
|
|
// RELOCS: Relocations [
|
|
|
|
// RELOCS: Section ({{.+}}) .rel{{a?}}.eh_frame {
|
|
|
|
// ABS32-NEXT: R_MIPS_32
|
|
|
|
// ABS64-NEXT: R_MIPS_64/R_MIPS_NONE/R_MIPS_NONE
|
|
|
|
// PIC32-NEXT: R_MIPS_PC32
|
|
|
|
// PIC64-NEXT: R_MIPS_PC32/R_MIPS_NONE/R_MIPS_NONE
|
|
|
|
// RELOCS-NEXT: }
|
2017-09-27 01:02:35 +08:00
|
|
|
|
2020-01-29 22:28:46 +08:00
|
|
|
// DWARF32: 00000000 00000010 00000000 CIE
|
2020-06-02 17:00:44 +08:00
|
|
|
// DWARF32-NEXT: Format: DWARF32
|
2020-01-12 18:55:15 +08:00
|
|
|
// DWARF32-NEXT: Version: 1
|
|
|
|
// DWARF32-NEXT: Augmentation: "zR"
|
|
|
|
// DWARF32-NEXT: Code alignment factor: 1
|
|
|
|
// DWARF32-NEXT: Data alignment factor: -4
|
|
|
|
// DWARF32-NEXT: Return address column: 31
|
|
|
|
// DWARF32_ABS-NEXT: Augmentation data: 0B
|
|
|
|
// ^^ fde pointer encoding: DW_EH_PE_sdata4
|
|
|
|
// DWARF32_PIC-NEXT: Augmentation data: 1B
|
|
|
|
// ^^ fde pointer encoding: DW_EH_PE_pcrel | DW_EH_PE_sdata4
|
|
|
|
// DWARF32-EMPTY:
|
|
|
|
// DWARF32-NEXT: DW_CFA_def_cfa_register: reg29
|
2017-09-27 01:02:35 +08:00
|
|
|
//
|
2020-07-18 23:59:05 +08:00
|
|
|
// DWARF32_ABS: 00000014 00000010 00000018 FDE cie=00000000 pc=00000000...00000000
|
|
|
|
// DWARF32_PIC: 00000014 00000010 00000018 FDE cie=00000000 pc=0000001c...0000001c
|
2020-06-02 17:00:44 +08:00
|
|
|
// DWARF32-NEXT: Format: DWARF32
|
2020-01-12 18:55:15 +08:00
|
|
|
// DWARF32-NEXT: DW_CFA_nop:
|
|
|
|
// DWARF32-NEXT: DW_CFA_nop:
|
|
|
|
// DWARF32-NEXT: DW_CFA_nop:
|
|
|
|
|
2017-09-27 01:02:35 +08:00
|
|
|
|
2020-01-29 22:28:46 +08:00
|
|
|
// DWARF64: 00000000 00000010 00000000 CIE
|
2020-06-02 17:00:44 +08:00
|
|
|
// DWARF64-NEXT: Format: DWARF32
|
2020-01-12 18:55:15 +08:00
|
|
|
// DWARF64-NEXT: Version: 1
|
|
|
|
// DWARF64-NEXT: Augmentation: "zR"
|
|
|
|
// DWARF64-NEXT: Code alignment factor: 1
|
|
|
|
// DWARF64-NEXT: Data alignment factor: -8
|
|
|
|
// ^^ GAS uses -4. Should be ok as long as
|
|
|
|
// all offsets we need are a multiple of 8.
|
|
|
|
// DWARF64-NEXT: Return address column: 31
|
|
|
|
// DWARF64_ABS-NEXT: Augmentation data: 0C
|
|
|
|
// ^^ fde pointer encoding: DW_EH_PE_sdata8
|
|
|
|
// DWARF64_PIC: Augmentation data: 1B
|
|
|
|
// ^^ fde pointer encoding: DW_EH_PE_pcrel | DW_EH_PE_sdata4
|
|
|
|
// DWARF64-EMPTY:
|
|
|
|
// DWARF64-NEXT: DW_CFA_def_cfa_register: reg29
|
|
|
|
// DWARF64_PIC-NEXT: DW_CFA_nop:
|
2017-09-27 01:02:35 +08:00
|
|
|
//
|
2020-02-13 19:20:14 +08:00
|
|
|
// DWARF64_ABS: 00000014 00000018 00000018 FDE cie=00000000 pc=00000000...00000000
|
|
|
|
// DWARF64_PIC: 00000014 00000010 00000018 FDE cie=00000000 pc=00000000...00000000
|
2020-06-02 17:00:44 +08:00
|
|
|
// DWARF64-NEXT: Format: DWARF32
|
2020-01-12 18:55:15 +08:00
|
|
|
// DWARF64-NEXT: DW_CFA_nop:
|
|
|
|
// DWARF64-NEXT: DW_CFA_nop:
|
|
|
|
// DWARF64-NEXT: DW_CFA_nop:
|