llvm.org GIT mirror llvm / a7321a6
MC: support FK_SecRel_4 for Windows on ARM Add handling for FK_SecRel_4 (4-byte section relative relocations). These are used by the generation of DWARF debug information (the abbrevations use section relative relocations). This will also be used in generation of CodeView line tables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207941 91177308-0d34-0410-b5e6-96231b3b80d8 Saleem Abdulrasool 6 years ago
3 changed file(s) with 48 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
314314 case FK_Data_1:
315315 case FK_Data_2:
316316 case FK_Data_4:
317 return Value;
318 case FK_SecRel_4:
317319 return Value;
318320 case ARM::fixup_arm_movt_hi16:
319321 if (!IsPCRel)
661663 case ARM::fixup_t2_movt_hi16:
662664 case ARM::fixup_t2_movw_lo16:
663665 return 4;
666
667 case FK_SecRel_4:
668 return 4;
664669 }
665670 }
666671
4848 default:
4949 return COFF::IMAGE_REL_ARM_ADDR32;
5050 }
51 case FK_SecRel_4:
52 return COFF::IMAGE_REL_ARM_SECREL;
5153 case ARM::fixup_t2_condbranch:
5254 return COFF::IMAGE_REL_ARM_BRANCH20T;
5355 case ARM::fixup_t2_uncondbranch:
0 ; RUN: llc -mtriple thumbv7--windows-itanium -filetype obj -o - %s \
1 ; RUN: | llvm-readobj -r - | FileCheck %s
2
3 ; ModuleID = '/Users/compnerd/work/llvm/test/MC/ARM/reduced.c'
4 target datalayout = "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-v128:64:128-a:0:32-n32-S64"
5 target triple = "thumbv7--windows-itanium"
6
7 define arm_aapcs_vfpcc void @function() {
8 entry:
9 ret void, !dbg !0
10 }
11
12 !llvm.dbg.cu = !{!7}
13 !llvm.module.flags = !{!9, !10}
14
15 !0 = metadata !{i32 1, i32 0, metadata !1, null}
16 !1 = metadata !{i32 786478, metadata !2, metadata !3, metadata !"function", metadata !"function", metadata !"", i32 1, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i32 0, i1 false, void ()* @function, null, null, metadata !6, i32 1} ; [ DW_TAG_subprogram ], [line 1], [def], [function]
17 !2 = metadata !{metadata !"/Users/compnerd/work/llvm/test/MC/ARM/reduced.c", metadata !"/Users/compnerd/work/llvm"}
18 !3 = metadata !{i32 786473, metadata !2} ; [ DW_TAG_file_type] [/Users/compnerd/work/llvm/test/MC/ARM/reduced.c]
19 !4 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !5, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ], [line 0, size 0, align 0, offset 0] [from ]
20 !5 = metadata !{null}
21 !6 = metadata !{}
22 !7 = metadata !{i32 786449, metadata !2, i32 12, metadata !"clang version 3.5.0", i1 false, metadata !"", i32 0, metadata !6, metadata !6, metadata !8, metadata !6, metadata !6, metadata !"", i32 1} ; [ DW_TAG_compile_unit ] [/Users/compnerd/work/llvm/test/MC/ARM/reduced.c] [DW_LANG_C99]
23 !8 = metadata !{metadata !1}
24 !9 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}
25 !10 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
26
27 ; CHECK: Relocations [
28 ; CHECK: Section {{.*}} .debug_info {
29 ; CHECK: 0x6 IMAGE_REL_ARM_SECREL .debug_abbrev
30 ; CHECK: 0xC IMAGE_REL_ARM_SECREL .debug_str
31 ; CHECK: 0x12 IMAGE_REL_ARM_SECREL .debug_str
32 ; CHECK: 0x16 IMAGE_REL_ARM_SECREL .debug_line
33 ; CHECK: 0x1A IMAGE_REL_ARM_SECREL .debug_str
34 ; CHECK: 0x27 IMAGE_REL_ARM_SECREL .debug_str
35 ; CHECK: }
36 ; CHECK: Section {{.*}}.debug_pubnames {
37 ; CHECK: 0x6 IMAGE_REL_ARM_SECREL .debug_info
38 ; CHECK: }
39 ; CHECK: ]
40