https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103241
--- Comment #7 from Will Cohen <wcohen at redhat dot com> ---
Looking at the set_mem.s the second issue of the 0-length location entry for
static_protections is coming from this bit of assembly in the set_memory.s:
.byte 0x4
.uleb128 .LVL637-.LVL615
.uleb128 .LHOTE19-.LVL615
.uleb128 0x3
.byte 0x53
.byte 0x93
.uleb128 0x8
The attached .s and .i files were from a local compile of linux git repo commit
8ab774587903771821b59471cc723bba6d893942. The part of the llvm-dwarf dump
related should be looking for is [0x0000000000001b1b, 0x0000000000001b1b).
llvm-dwarfdump -c --name="static_protections" arch/x86/mm/pat/set_memory.o
|more
0x00019218: DW_TAG_subprogram
DW_AT_abstract_origin (0x00014236 "static_protections")
DW_AT_ranges (0x00000bc0
[0x0000000000001990, 0x0000000000001b1b)
[0x0000000000000000, 0x00000000000000bd))
DW_AT_frame_base (DW_OP_call_frame_cfa)
DW_AT_call_all_calls (true)
DW_AT_sibling (0x00019807)
0x00019228: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x00014248 "prot")
DW_AT_location (0x00006f38:
[0x0000000000001990, 0x0000000000001990): DW_OP_reg5 RDI
[0x0000000000001990, 0x00000000000019b9): DW_OP_reg5 RDI,
DW_
OP_piece 0x8
[0x00000000000019f0, 0x0000000000001a43): DW_OP_reg5 RDI
[0x0000000000001a67, 0x0000000000001aab): DW_OP_reg3 RBX
[0x0000000000001ace, 0x0000000000001adc): DW_OP_reg5 RDI
[0x0000000000001adc, 0x0000000000001af1): DW_OP_reg3 RBX,
DW_
OP_piece 0x8
[0x0000000000001af1, 0x0000000000001af1): DW_OP_reg3 RBX,
DW_
OP_piece 0x8
[0x0000000000001af1, 0x0000000000001b1b): DW_OP_reg3 RBX
[0x0000000000001b1b, 0x0000000000001b1b): DW_OP_reg3 RBX,
DW_
OP_piece 0x8
[0x0000000000000000, 0x000000000000002d): DW_OP_reg3 RBX,
DW_
OP_piece 0x8
[0x000000000000004e, 0x000000000000007e): DW_OP_reg3 RBX
[0x000000000000007e, 0x00000000000000bd): DW_OP_reg3 RBX,
DW_
OP_piece 0x8)
DW_AT_unknown_2137 (0x00006f20)
0x00019235: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x00014255 "start")
DW_AT_location (0x00006fb1:
[0x0000000000001990, 0x00000000000019f0): DW_OP_reg4 RSI
[0x00000000000019f0, 0x0000000000001aab): DW_OP_reg12 R12
[0x0000000000001aab, 0x0000000000001aba):
DW_OP_entry_value(D
W_OP_reg4 RSI), DW_OP_stack_value
[0x0000000000001aba, 0x0000000000001adc): DW_OP_reg4 RSI
[0x0000000000001adc, 0x0000000000001b1b): DW_OP_reg12 R12
[0x0000000000001b1b, 0x0000000000001b1b): DW_OP_reg4 RSI
[0x0000000000000000, 0x0000000000000025): DW_OP_reg4 RSI
[0x0000000000000025, 0x00000000000000bd): DW_OP_reg12 R12)
DW_AT_unknown_2137 (0x00006fa1)
0x00019242: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x00014262 "pfn")
DW_AT_location (0x00007009:
[0x0000000000001990, 0x00000000000019f0): DW_OP_reg1 RDX
[0x00000000000019f0, 0x0000000000001aab): DW_OP_reg15 R15
[0x0000000000001aab, 0x0000000000001aba):
DW_OP_entry_value(D
W_OP_reg1 RDX), DW_OP_stack_value
[0x0000000000001aba, 0x0000000000001adc): DW_OP_reg1 RDX
[0x0000000000001adc, 0x0000000000001b1b): DW_OP_reg15 R15
[0x0000000000001b1b, 0x0000000000001b1b): DW_OP_reg1 RDX
[0x0000000000000000, 0x000000000000001c): DW_OP_reg1 RDX
[0x000000000000001c, 0x00000000000000bd): DW_OP_reg15 R15)
DW_AT_unknown_2137 (0x00006ff9)
0x0001924f: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x0001426f "npg")
DW_AT_location (0x00007061:
[0x0000000000001990, 0x00000000000019f0): DW_OP_reg2 RCX
[0x00000000000019f0, 0x0000000000001aab): DW_OP_reg13 R13
[0x0000000000001aab, 0x0000000000001aba):
DW_OP_entry_value(D
W_OP_reg2 RCX), DW_OP_stack_value
[0x0000000000001aba, 0x0000000000001adc): DW_OP_reg2 RCX
[0x0000000000001adc, 0x0000000000001b1b): DW_OP_reg13 R13
[0x0000000000001b1b, 0x0000000000001b1b): DW_OP_reg2 RCX
[0x0000000000000000, 0x0000000000000010): DW_OP_reg2 RCX
[0x0000000000000010, 0x00000000000000bd): DW_OP_reg13 R13)
DW_AT_unknown_2137 (0x00007051)
0x0001925c: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x0001427c "lpsize")
DW_AT_location (0x000070b3:
[0x0000000000001990, 0x00000000000019d5): DW_OP_reg8 R8
[0x00000000000019d5, 0x0000000000001aab): DW_OP_reg14 R14
[0x0000000000001aab, 0x0000000000001aba):
DW_OP_entry_value(D
W_OP_reg8 R8), DW_OP_stack_value
[0x0000000000001aba, 0x0000000000001b1b): DW_OP_reg14 R14
[0x0000000000000000, 0x00000000000000bd): DW_OP_reg14 R14)
DW_AT_unknown_2137 (0x000070a9)
0x00019269: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x00014289 "warnlvl")
DW_AT_location (0x000070f4:
[0x0000000000001990, 0x00000000000019f0): DW_OP_reg9 R9
[0x00000000000019f0, 0x0000000000001aba): DW_OP_fbreg -72
[0x0000000000001aba, 0x0000000000001adc): DW_OP_reg9 R9
[0x0000000000001adc, 0x0000000000001b1b): DW_OP_fbreg -72
[0x0000000000001b1b, 0x0000000000001b1b): DW_OP_reg9 R9
[0x0000000000000000, 0x000000000000000d): DW_OP_reg9 R9
[0x000000000000000d, 0x00000000000000bd): DW_OP_fbreg -72)
DW_AT_unknown_2137 (0x000070e6)