Uniquify function flag realnames (#6601)

This commit is contained in:
Khairul Azhar Kasmiran 2026-07-05 22:33:25 +08:00 committed by GitHub
parent 6f630b785e
commit 4897885c5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 370 additions and 307 deletions

View file

@ -361,11 +361,15 @@ static void destroy(RzBinFile *bf) {
}
static int get_file_type(RzBinFile *bf) {
struct Elf_(rz_bin_elf_obj_t) *obj = bf->o->bin_obj;
char *type = Elf_(rz_bin_elf_get_file_type(obj));
int res = type ? ((!strncmp(type, "CORE", 4)) ? RZ_BIN_TYPE_CORE : RZ_BIN_TYPE_DEFAULT) : -1;
free(type);
return res;
ELFOBJ *bin = rz_bin_file_get_elf(bf);
switch (bin->ehdr.e_type) {
case ET_REL:
return RZ_BIN_TYPE_REL;
case ET_CORE:
return RZ_BIN_TYPE_CORE;
default:
return RZ_BIN_TYPE_DEFAULT;
}
}
static char *regstate(RzBinFile *bf) {

View file

@ -684,7 +684,8 @@ void propagate_types_among_used_variables(RzCore *core, HtUP *op_cache, RzAnalys
} else if (aop->ptr != UT64_MAX) {
RzFlagItem *flag = rz_flag_get_by_spaces(core->flags, aop->ptr, RZ_FLAGS_FS_IMPORTS, NULL);
if (flag && flag->realname) {
full_name = flag->realname;
char *reloc_prefix = (char *)rz_str_rstr(flag->realname, "reloc.");
full_name = reloc_prefix ? reloc_prefix + 6 : flag->realname;
callee_addr = aop->ptr;
}
}

View file

@ -1250,27 +1250,42 @@ static void reloc_set_flag(RzCore *core, RzBinReloc *reloc, const char *prefix,
free(reloc_name);
return;
}
char *flag_prefix = NULL;
char *flag_name = NULL;
if (core->bin->prefix) {
flag_name = rz_str_newf("%s.%s.%s", core->bin->prefix, prefix, reloc_name);
flag_prefix = rz_str_newf("%s.%s", core->bin->prefix, prefix);
} else {
flag_name = rz_str_newf("%s.%s", prefix, reloc_name);
flag_prefix = strdup(prefix);
}
flag_name = rz_str_newf("%s.%s", flag_prefix, reloc_name);
rz_name_filter(flag_name, 0, true);
RzFlagItem *existing = rz_flag_get(core->flags, flag_name);
if (existing && existing->offset == flag_addr) {
// Mostly important for target flags.
// We don't want hundreds of reloc.target.<fcnname>.<xyz> flags at the same location
free(reloc_name);
free(flag_name);
return;
goto beach;
}
RzFlagItem *fi = rz_flag_set_next(core->flags, flag_name, flag_addr, bin_reloc_size(reloc));
if (fi) {
RzBinFile *binfile = rz_bin_cur(core->bin);
RzBinPlugin *plugin = rz_bin_file_cur_plugin(binfile);
if (plugin && binfile && plugin->file_type &&
(plugin->file_type(binfile) != RZ_BIN_TYPE_REL || strcmp(prefix, "reloc.target"))) {
char *suffix = "";
if (strcmp(flag_name, fi->name)) { // there is a suffix
suffix = strrchr(fi->name, '.');
}
char *prefixed_reloc_name = rz_str_newf("%s.%s%s", flag_prefix, reloc_name, suffix);
rz_flag_item_set_realname(fi, prefixed_reloc_name);
free(prefixed_reloc_name);
} else {
rz_flag_item_set_realname(fi, reloc_name);
}
}
beach:
free(reloc_name);
free(flag_prefix);
free(flag_name);
}

View file

@ -185,7 +185,8 @@ typedef enum {
enum {
RZ_BIN_TYPE_DEFAULT = 0,
RZ_BIN_TYPE_CORE = 1
RZ_BIN_TYPE_CORE = 1,
RZ_BIN_TYPE_REL = 2
};
#define RZ_BIN_STRING_SEARCH_MIN_STRING 4

View file

@ -792,7 +792,7 @@ agf json_disasm
agf sdb
EOF
EXPECT=<<EOF
.-----------------------------------------------------------------------.
.--------------------------------------------------------.
| 0x6a0 |
| ; [13] -r-x section size 546 named .text |
| ;-- section..text: |
@ -815,11 +815,11 @@ EXPECT=<<EOF
| lea rcx, qword [sym.__libc_csu_init] |
| ; 0x7aa |
| lea rdi, qword [main] |
| ; [reloc.__libc_start_main:8]=0x201058 reloc.target.__libc_start_main |
| ; [0x200fe0:8]=0x201058 reloc.target.__libc_start_main |
| ; "X\U00000010 " |
| call qword [reloc.__libc_start_main] |
`-----------------------------------------------------------------------'
agn "0x6a0" base64:OyBbMTNdIC1yLXggc2VjdGlvbiBzaXplIDU0NiBuYW1lZCAudGV4dAogIDstLSBzZWN0aW9uLi50ZXh0OgogIDstLSAudGV4dDoKICA7LS0gX3N0YXJ0OgplbnRyeTAoaW50NjRfdCBhcmczKTsKOyBhcmcgaW50NjRfdCBhcmczIEAgcmR4CnhvciBlYnAsIGVicAo7IGFyZzMKbW92IHI5LCByZHgKcG9wIHJzaQptb3YgcmR4LCByc3AKYW5kIHJzcCwgMHhmZmZmZmZmZmZmZmZmZmYwCnB1c2ggcmF4CnB1c2ggcnNwCjsgMHg4YzAKbGVhIHI4LCBxd29yZCBbc3ltLl9fbGliY19jc3VfZmluaV0KOyAweDg1MAo7ICJBV0FWQVx4ODlceGZmQVVBVExceDhkJS5cVTAwMDAwMDA1ICIKbGVhIHJjeCwgcXdvcmQgW3N5bS5fX2xpYmNfY3N1X2luaXRdCjsgMHg3YWEKbGVhIHJkaSwgcXdvcmQgW21haW5dCjsgW3JlbG9jLl9fbGliY19zdGFydF9tYWluOjhdPTB4MjAxMDU4IHJlbG9jLnRhcmdldC5fX2xpYmNfc3RhcnRfbWFpbgo7ICJYXFUwMDAwMDAxMCAiCmNhbGwgcXdvcmQgW3JlbG9jLl9fbGliY19zdGFydF9tYWluXQ==
`--------------------------------------------------------'
agn "0x6a0" base64:OyBbMTNdIC1yLXggc2VjdGlvbiBzaXplIDU0NiBuYW1lZCAudGV4dAogIDstLSBzZWN0aW9uLi50ZXh0OgogIDstLSAudGV4dDoKICA7LS0gX3N0YXJ0OgplbnRyeTAoaW50NjRfdCBhcmczKTsKOyBhcmcgaW50NjRfdCBhcmczIEAgcmR4CnhvciBlYnAsIGVicAo7IGFyZzMKbW92IHI5LCByZHgKcG9wIHJzaQptb3YgcmR4LCByc3AKYW5kIHJzcCwgMHhmZmZmZmZmZmZmZmZmZmYwCnB1c2ggcmF4CnB1c2ggcnNwCjsgMHg4YzAKbGVhIHI4LCBxd29yZCBbc3ltLl9fbGliY19jc3VfZmluaV0KOyAweDg1MAo7ICJBV0FWQVx4ODlceGZmQVVBVExceDhkJS5cVTAwMDAwMDA1ICIKbGVhIHJjeCwgcXdvcmQgW3N5bS5fX2xpYmNfY3N1X2luaXRdCjsgMHg3YWEKbGVhIHJkaSwgcXdvcmQgW21haW5dCjsgWzB4MjAwZmUwOjhdPTB4MjAxMDU4IHJlbG9jLnRhcmdldC5fX2xpYmNfc3RhcnRfbWFpbgo7ICJYXFUwMDAwMDAxMCAiCmNhbGwgcXdvcmQgW3JlbG9jLl9fbGliY19zdGFydF9tYWluXQ==
digraph code {
rankdir=LR;
outputorder=edgesfirst
@ -847,7 +847,7 @@ lea r8, qword [sym.__libc_csu_fini]
lea rcx, qword [sym.__libc_csu_init]
; 0x7aa
lea rdi, qword [main]
; [reloc.__libc_start_main:8]=0x201058 reloc.target.__libc_start_main
; [0x200fe0:8]=0x201058 reloc.target.__libc_start_main
; 'X\U00000010 '
call qword [reloc.__libc_start_main]
"]
@ -862,20 +862,20 @@ directed 1
label "0x6a0"
]
]
{"nodes":[{"id":0,"title":"0x6a0","body":"; [13] -r-x section size 546 named .text\n ;-- section..text:\n ;-- .text:\n ;-- _start:\nentry0(int64_t arg3);\n; arg int64_t arg3 @ rdx\nxor ebp, ebp\n; arg3\nmov r9, rdx\npop rsi\nmov rdx, rsp\nand rsp, 0xfffffffffffffff0\npush rax\npush rsp\n; 0x8c0\nlea r8, qword [sym.__libc_csu_fini]\n; 0x850\n; \"AWAVA\\x89\\xffAUATL\\x8d%.\\U00000005 \"\nlea rcx, qword [sym.__libc_csu_init]\n; 0x7aa\nlea rdi, qword [main]\n; [reloc.__libc_start_main:8]=0x201058 reloc.target.__libc_start_main\n; \"X\\U00000010 \"\ncall qword [reloc.__libc_start_main]\n","offset":1696,"out_nodes":[]}]}
{"nodes":[{"id":0,"title":"0x6a0","body":"; [13] -r-x section size 546 named .text\n ;-- section..text:\n ;-- .text:\n ;-- _start:\nentry0(int64_t arg3);\n; arg int64_t arg3 @ rdx\nxor ebp, ebp\n; arg3\nmov r9, rdx\npop rsi\nmov rdx, rsp\nand rsp, 0xfffffffffffffff0\npush rax\npush rsp\n; 0x8c0\nlea r8, qword [sym.__libc_csu_fini]\n; 0x850\n; \"AWAVA\\x89\\xffAUATL\\x8d%.\\U00000005 \"\nlea rcx, qword [sym.__libc_csu_init]\n; 0x7aa\nlea rdi, qword [main]\n; [reloc.__libc_start_main:8]=0x201058 reloc.target.__libc_start_main\n; \"X\\U00000010 \"\ncall qword [reloc.__libc_start_main]\n","offset":1696,"out_nodes":[]}]}
{"nodes":[{"id":0,"title":"0x6a0","body":"; [13] -r-x section size 546 named .text\n ;-- section..text:\n ;-- .text:\n ;-- _start:\nentry0(int64_t arg3);\n; arg int64_t arg3 @ rdx\nxor ebp, ebp\n; arg3\nmov r9, rdx\npop rsi\nmov rdx, rsp\nand rsp, 0xfffffffffffffff0\npush rax\npush rsp\n; 0x8c0\nlea r8, qword [sym.__libc_csu_fini]\n; 0x850\n; \"AWAVA\\x89\\xffAUATL\\x8d%.\\U00000005 \"\nlea rcx, qword [sym.__libc_csu_init]\n; 0x7aa\nlea rdi, qword [main]\n; [0x200fe0:8]=0x201058 reloc.target.__libc_start_main\n; \"X\\U00000010 \"\ncall qword [reloc.__libc_start_main]\n","offset":1696,"out_nodes":[]}]}
{"nodes":[{"id":0,"title":"0x6a0","body":"; [13] -r-x section size 546 named .text\n ;-- section..text:\n ;-- .text:\n ;-- _start:\nentry0(int64_t arg3);\n; arg int64_t arg3 @ rdx\nxor ebp, ebp\n; arg3\nmov r9, rdx\npop rsi\nmov rdx, rsp\nand rsp, 0xfffffffffffffff0\npush rax\npush rsp\n; 0x8c0\nlea r8, qword [sym.__libc_csu_fini]\n; 0x850\n; \"AWAVA\\x89\\xffAUATL\\x8d%.\\U00000005 \"\nlea rcx, qword [sym.__libc_csu_init]\n; 0x7aa\nlea rdi, qword [main]\n; [0x200fe0:8]=0x201058 reloc.target.__libc_start_main\n; \"X\\U00000010 \"\ncall qword [reloc.__libc_start_main]\n","offset":1696,"out_nodes":[]}]}
agraph.color_box=G1swbQ==
agraph.delta_x=0xb
agraph.delta_x=0x4
agraph.delta_y=0x1
agraph.h=0x1e
agraph.is_callgraph=false
agraph.nodes=0x6a0
agraph.nodes.0x6a0.body=base64:OyBbMTNdIC1yLXggc2VjdGlvbiBzaXplIDU0NiBuYW1lZCAudGV4dAogIDstLSBzZWN0aW9uLi50ZXh0OgogIDstLSAudGV4dDoKICA7LS0gX3N0YXJ0OgplbnRyeTAoaW50NjRfdCBhcmczKTsKOyBhcmcgaW50NjRfdCBhcmczIEAgcmR4CnhvciBlYnAsIGVicAo7IGFyZzMKbW92IHI5LCByZHgKcG9wIHJzaQptb3YgcmR4LCByc3AKYW5kIHJzcCwgMHhmZmZmZmZmZmZmZmZmZmYwCnB1c2ggcmF4CnB1c2ggcnNwCjsgMHg4YzAKbGVhIHI4LCBxd29yZCBbc3ltLl9fbGliY19jc3VfZmluaV0KOyAweDg1MAo7ICJBV0FWQVx4ODlceGZmQVVBVExceDhkJS5cVTAwMDAwMDA1ICIKbGVhIHJjeCwgcXdvcmQgW3N5bS5fX2xpYmNfY3N1X2luaXRdCjsgMHg3YWEKbGVhIHJkaSwgcXdvcmQgW21haW5dCjsgW3JlbG9jLl9fbGliY19zdGFydF9tYWluOjhdPTB4MjAxMDU4IHJlbG9jLnRhcmdldC5fX2xpYmNfc3RhcnRfbWFpbgo7ICJYXFUwMDAwMDAxMCAiCmNhbGwgcXdvcmQgW3JlbG9jLl9fbGliY19zdGFydF9tYWluXQ==
agraph.nodes.0x6a0.body=base64:OyBbMTNdIC1yLXggc2VjdGlvbiBzaXplIDU0NiBuYW1lZCAudGV4dAogIDstLSBzZWN0aW9uLi50ZXh0OgogIDstLSAudGV4dDoKICA7LS0gX3N0YXJ0OgplbnRyeTAoaW50NjRfdCBhcmczKTsKOyBhcmcgaW50NjRfdCBhcmczIEAgcmR4CnhvciBlYnAsIGVicAo7IGFyZzMKbW92IHI5LCByZHgKcG9wIHJzaQptb3YgcmR4LCByc3AKYW5kIHJzcCwgMHhmZmZmZmZmZmZmZmZmZmYwCnB1c2ggcmF4CnB1c2ggcnNwCjsgMHg4YzAKbGVhIHI4LCBxd29yZCBbc3ltLl9fbGliY19jc3VfZmluaV0KOyAweDg1MAo7ICJBV0FWQVx4ODlceGZmQVVBVExceDhkJS5cVTAwMDAwMDA1ICIKbGVhIHJjeCwgcXdvcmQgW3N5bS5fX2xpYmNfY3N1X2luaXRdCjsgMHg3YWEKbGVhIHJkaSwgcXdvcmQgW21haW5dCjsgWzB4MjAwZmUwOjhdPTB4MjAxMDU4IHJlbG9jLnRhcmdldC5fX2xpYmNfc3RhcnRfbWFpbgo7ICJYXFUwMDAwMDAxMCAiCmNhbGwgcXdvcmQgW3JlbG9jLl9fbGliY19zdGFydF9tYWluXQ==
agraph.nodes.0x6a0.h=0x1b
agraph.nodes.0x6a0.w=0x49
agraph.nodes.0x6a0.w=0x3a
agraph.nodes.0x6a0.x=0
agraph.nodes.0x6a0.y=0xb
agraph.w=0x49
agraph.nodes.0x6a0.y=0x4
agraph.w=0x3a
EOF
RUN

View file

@ -211,7 +211,7 @@ s reloc.operator_delete_void
fl.j~{0}
EOF
EXPECT=<<EOF
{"name":"reloc.operator_delete_void","realname":"operator delete(void*)","size":8,"offset":16432}
{"name":"reloc.operator_delete_void","realname":"reloc.operator delete(void*)","size":8,"offset":16432}
EOF
RUN

View file

@ -2206,7 +2206,7 @@ EXPECT=<<EOF
| 0x00005af3 4c8d05660c01. lea r8, qword [0x00016760]
| 0x00005afa 488d0def0b01. lea rcx, qword [0x000166f0]
| 0x00005b01 488d3d68e5ff. lea rdi, qword [main] ; 0x4070 ; "AWAVAUATU\x89\xfdSH\x89\xf3H\x83\xecXH\x8b>dH\x8b\U00000004%("
\ 0x00005b08 ff150ac30100 call qword [reloc.__libc_start_main] ; [reloc.__libc_start_main:8]=0x23708 reloc.target.__libc_start_main
\ 0x00005b08 ff150ac30100 call qword [reloc.__libc_start_main] ; [0x21e18:8]=0x23708 reloc.target.__libc_start_main
EOF
RUN

View file

@ -341,7 +341,7 @@ EXPECT=<<EOF
,=< 0x00005b02 7d0a jnl 0x5b0e ; rip=0x5b0e -> 0x8d4890f4 ; likely
,==< 0x00005b04 7f08 jnle 0x5b0e ; rip=0x5b0e -> 0x8d4890f4 ; likely
,===< 0x00005b06 eb00 jmp 0x5b08 ; rip=0x5b08 -> 0xc30a15ff
`---> 0x00005b08 ff150ac30100 call qword [reloc.__libc_start_main] ; [reloc.__libc_start_main:8]=0x23708 reloc.target.__libc_start_main ; rsp=0xfffffffffffffff8 ; rip=0x23708 -> 0x464c457f reloc.target.__libc_start_main
`---> 0x00005b08 ff150ac30100 call qword [reloc.__libc_start_main] ; [0x21e18:8]=0x23708 reloc.target.__libc_start_main ; rsp=0xfffffffffffffff8 ; rip=0x23708 -> 0x464c457f reloc.target.__libc_start_main
EOF
RUN

View file

@ -113,7 +113,7 @@ EXPECT=<<EOF
0x10000320 lis r8, 0x1000 ; start.S:83
0x10000324 lwzu r13, 0x62c(r8) ; start.S:84
0x10000328 b reloc.__libc_start_main ; start.S:87
;-- __libc_start_main:
;-- reloc.__libc_start_main:
0x10020074 invalid
EOF
RUN

View file

@ -20,34 +20,34 @@ EXPECT=<<EOF
0x0800006a 0x0000006a 0x08000042 R_X86_64_GOTPC32 GOT - 0x0800006a
---
;-- section..reloc_test:
;-- target:
;-- reloc.target:
;-- abs8:
0x08000048 .byte 0x42 ; RELOC 8 target @ 0x08000042 ; [04] -r-- section size 38 named .reloc_test
;-- target:
;-- reloc.target.8000049:
;-- abs16:
0x08000049 .word 0x0042 ; RELOC 16 target @ 0x08000042
;-- target:
;-- reloc.target.800004b:
;-- abs32:
0x0800004b .dword 0x08000042 ; reloc.target.target ; loc.target; RELOC 32 target @ 0x08000042
;-- target:
;-- reloc.target.800004f:
;-- abs32s:
0x0800004f .dword 0x08000042 ; reloc.target.target ; loc.target; RELOC 32 target @ 0x08000042
;-- target:
;-- reloc.target.8000053:
;-- abs64:
0x08000053 .qword 0x0000000008000042 ; reloc.target.target ; loc.target; RELOC 64 target @ 0x08000042
;-- target:
;-- reloc.target.800005b:
;-- pc8:
0x0800005b .byte 0xe7 ; RELOC 8 target @ 0x08000042 - 0x800005b
;-- target:
;-- reloc.target.800005c:
;-- pc16:
0x0800005c .word 0xffe6 ; RELOC 16 target @ 0x08000042 - 0x800005c
;-- target:
;-- reloc.target.800005e:
;-- pc32:
0x0800005e .dword 0xffffffe4 ; RELOC 32 target @ 0x08000042 - 0x800005e
;-- target:
;-- reloc.target.8000062:
;-- pc64:
0x08000062 .qword 0xffffffffffffffe0 ; RELOC 64 target @ 0x08000042 - 0x8000062
;-- target:
;-- reloc.target.800006a:
;-- gotpc32:
0x0800006a .dword 0xf7ffff96 ; RELOC 32 target @ 0x08000042 - 0x800006a
EOF

View file

@ -21,37 +21,37 @@ EXPECT=<<EOF
0x08000150 0x00000150 0x08000178 R_AARCH64_MOVW_UABS_G1_NC .data + 0x00000050
0x08000154 0x00000154 0x08000178 R_AARCH64_MOVW_UABS_G2_NC .data + 0x00000050
0x08000158 0x00000158 0x08000178 R_AARCH64_MOVW_UABS_G3 .data + 0x00000050
;-- .data:
;-- reloc..data.8000058:
;-- test_movw_uabs:
0x08000058 mov x0, 0x178 ; RELOC 64 .data @ 0x08000178
;-- .data:
;-- reloc..data.800005c:
0x0800005c movk x0, 0x178 ; RELOC 64 .data @ 0x08000178
;-- .data:
;-- reloc..data.8000060:
0x08000060 mov x1, segment.ehdr ; RELOC 64 .data @ 0x08000178
;-- .data:
;-- reloc..data.8000064:
0x08000064 movk x1, 0x800, lsl 16 ; RELOC 64 .data @ 0x08000178
;-- .data:
;-- reloc..data.8000068:
0x08000068 movz x2, 0, lsl 32 ; RELOC 64 .data @ 0x08000178
;-- .data:
;-- reloc..data.800006c:
0x0800006c movk x2, 0, lsl 32 ; RELOC 64 .data @ 0x08000178
;-- .data:
;-- reloc..data.8000070:
0x08000070 movz x3, 0, lsl 48 ; RELOC 64 .data @ 0x08000178
;-- .data:
;-- reloc..data.8000074:
0x08000074 movz x4, 0, lsl 48 ; RELOC 64 .data @ 0x08000178
;-- .data:
;-- reloc..data.8000078:
0x08000078 movk x4, 0, lsl 32 ; RELOC 64 .data @ 0x08000178
;-- .data:
;-- reloc..data.800007c:
0x0800007c movk x4, 0x800, lsl 16 ; RELOC 64 .data @ 0x08000178
;-- .data:
;-- reloc..data.8000080:
0x08000080 movk x4, 0x178 ; RELOC 64 .data @ 0x08000178
0x08000084 ret
;-- .data:
;-- reloc..data.800014c:
0x0800014c mov x1, 0x1c8 ; RELOC 64 .data @ 0x08000178 + 0x50
;-- .data:
;-- reloc..data.8000150:
0x08000150 movk x1, 0x800, lsl 16 ; RELOC 64 .data @ 0x08000178 + 0x50
;-- .data:
;-- reloc..data.8000154:
0x08000154 movk x1, 0, lsl 32 ; RELOC 64 .data @ 0x08000178 + 0x50
;-- .data:
;-- reloc..data.8000158:
0x08000158 movk x1, 0, lsl 48 ; RELOC 64 .data @ 0x08000178 + 0x50
EOF
RUN
@ -66,12 +66,12 @@ EXPECT=<<EOF
0x08000088 0x00000088 0x08000178 R_AARCH64_MOVW_SABS_G0 .data
0x0800008c 0x0000008c 0x08000178 R_AARCH64_MOVW_SABS_G1 .data
0x08000090 0x00000090 0x08000178 R_AARCH64_MOVW_SABS_G2 .data
;-- .data:
;-- reloc..data.8000088:
;-- test_movw_sabs:
0x08000088 mov x0, 0x178 ; RELOC 64 .data @ 0x08000178
;-- .data:
;-- reloc..data.800008c:
0x0800008c mov x1, segment.ehdr ; RELOC 64 .data @ 0x08000178
;-- .data:
;-- reloc..data.8000090:
0x08000090 movz x2, 0, lsl 32 ; RELOC 64 .data @ 0x08000178
EOF
RUN
@ -90,20 +90,20 @@ EXPECT=<<EOF
0x0800011c 0x0000011c 0x08000178 R_AARCH64_MOVW_PREL_G2 .data - 0x0800011c
0x08000120 0x00000120 0x08000178 R_AARCH64_MOVW_PREL_G2_NC .data - 0x08000120
0x08000124 0x00000124 0x08000178 R_AARCH64_MOVW_PREL_G3 .data - 0x08000124
;-- .data:
;-- reloc..data.800010c:
;-- test_movw_prel:
0x0800010c mov x0, 0x6c ; 'l'; RELOC 64 .data @ 0x08000178 - 0x800010c
;-- .data:
;-- reloc..data.8000110:
0x08000110 movk x0, 0x68 ; RELOC 64 .data @ 0x08000178 - 0x8000110
;-- .data:
;-- reloc..data.8000114:
0x08000114 movz x1, 0, lsl 16 ; RELOC 64 .data @ 0x08000178 - 0x8000114
;-- .data:
;-- reloc..data.8000118:
0x08000118 movk x1, 0, lsl 16 ; RELOC 64 .data @ 0x08000178 - 0x8000118
;-- .data:
;-- reloc..data.800011c:
0x0800011c movz x2, 0, lsl 32 ; RELOC 64 .data @ 0x08000178 - 0x800011c
;-- .data:
;-- reloc..data.8000120:
0x08000120 movk x2, 0, lsl 32 ; RELOC 64 .data @ 0x08000178 - 0x8000120
;-- .data:
;-- reloc..data.8000124:
0x08000124 movz x3, 0, lsl 48 ; RELOC 64 .data @ 0x08000178 - 0x8000124
0x08000128 ret
EOF
@ -115,14 +115,14 @@ CMDS=<<EOF
pd 4 @ 0x0800012c
EOF
EXPECT=<<EOF
;-- .data:
;-- reloc..data.800012c:
;-- test_got_relative:
0x0800012c adrp x0, 0xfffffffffffff000 ; RELOC 0 .data @ 0x08000178
;-- .data:
;-- reloc..data.8000130:
0x08000130 adrp x0, 0xfffffffffffff000 ; RELOC 0 .data @ 0x08000178
;-- .data:
;-- reloc..data.8000134:
0x08000134 ldr x0, [x0, 0x6000] ; [0x6000:4]=-1; RELOC 0 .data @ 0x08000178
;-- .data:
;-- reloc..data.8000138:
0x08000138 ldr x1, 0x7fffffc ; [0x7fffffc:4]=-1; RELOC 32 .data @ 0x08000178 - 0x8000138
EOF
RUN
@ -139,26 +139,26 @@ EXPECT=<<EOF
0x080000cc 0x000000cc 0x08000178 R_AARCH64_LDST32_ABS_LO12_NC .data + 0x0000000c
0x080000d4 0x000000d4 0x08000178 R_AARCH64_LDST64_ABS_LO12_NC .data + 0x00000010
0x080000dc 0x000000dc 0x08000178 R_AARCH64_LDST128_ABS_LO12_NC .data + 0x00000020
;-- .data:
;-- reloc..data.80000b8:
;-- test_ldst_abs_lo12:
0x080000b8 adrp x0, segment.ehdr ; 0x8000000; RELOC 0 .data @ 0x08000178 + 0x8
;-- .data:
;-- reloc..data.80000bc:
0x080000bc ldrb w1, [x0] ; RELOC 64 .data @ 0x08000178 + 0x8
;-- .data:
;-- reloc..data.80000c0:
0x080000c0 adrp x0, segment.ehdr ; 0x8000000; RELOC 0 .data @ 0x08000178 + 0xa
;-- .data:
;-- reloc..data.80000c4:
0x080000c4 ldrh w1, [x0, 0x800] ; [0x800:4]=-1 ; 2048; RELOC 64 .data @ 0x08000178 + 0xa
;-- .data:
;-- reloc..data.80000c8:
0x080000c8 adrp x0, segment.ehdr ; 0x8000000; RELOC 0 .data @ 0x08000178 + 0xc
;-- .data:
;-- reloc..data.80000cc:
0x080000cc ldr w1, [x0, 0x1000] ; [0x1000:4]=-1; RELOC 64 .data @ 0x08000178 + 0xc
;-- .data:
;-- reloc..data.80000d0:
0x080000d0 adrp x0, segment.ehdr ; 0x8000000; RELOC 0 .data @ 0x08000178 + 0x10
;-- .data:
;-- reloc..data.80000d4:
0x080000d4 ldr x1, [x0, 0x2000] ; [0x2000:4]=-1; RELOC 64 .data @ 0x08000178 + 0x10
;-- .data:
;-- reloc..data.80000d8:
0x080000d8 adrp x0, segment.ehdr ; 0x8000000; RELOC 0 .data @ 0x08000178 + 0x20
;-- .data:
;-- reloc..data.80000dc:
0x080000dc ldr q0, [x0, 0x4000] ; [0x4000:4]=-1; RELOC 64 .data @ 0x08000178 + 0x20
EOF
RUN
@ -169,9 +169,9 @@ CMDS=<<EOF
pd 2 @ 0x080001b0
EOF
EXPECT=<<EOF
;-- .data:
;-- reloc..data.80001b0:
0x080001b0 .dword 0x08000178 ; section..data ; reloc.target..data ; sym..data ; loc.defined_data; RELOC 32 .data @ 0x08000178
;-- .data:
;-- reloc..data.80001b4:
0x080001b4 .word 0x0178 ; RELOC 16 .data @ 0x08000178
EOF
RUN
@ -189,12 +189,12 @@ EXPECT=<<EOF
0x08000044 0x00000044 0x08000188 R_AARCH64_JUMP26 bar - 0x08000044
0x08000048 0x00000048 0x08000190 R_AARCH64_JUMP26 weak - 0x08000048
;-- section..text:
;-- foo:
;-- reloc.foo:
;-- _start:
,=< 0x08000040 b loc.foo ; RELOC 64 foo @ 0x0800004c - 0x8000040 ; [02] -r-x section size 12 named .text
| ;-- bar:
| ;-- reloc.bar:
,==< 0x08000044 b reloc.target.bar ; RELOC 64 bar
|| ;-- weak:
|| ;-- reloc.weak:
,===< 0x08000048 b reloc.target.weak ; RELOC 64 weak
EOF
RUN
@ -212,12 +212,12 @@ EXPECT=<<EOF
0x08000044 0x00000044 0x00000008 R_AARCH64_LD64_GOTPAGE_LO15 global1
0x08000048 0x00000048 0x00000008 R_AARCH64_LD64_GOTPAGE_LO15 global2
;-- section..text:
;-- _GLOBAL_OFFSET_TABLE_:
;-- reloc._GLOBAL_OFFSET_TABLE_:
;-- _start:
0x08000040 adrp x0, segment.ehdr ; 0x8000000; RELOC 0 _GLOBAL_OFFSET_TABLE_ ; [02] -r-x section size 12 named .text
;-- global1:
;-- reloc.global1:
0x08000044 ldr x0, [x0, 0x7ff8] ; [0x7ff8:4]=-1; RELOC 0 global1 @ 0x00000008
;-- global2:
;-- reloc.global2:
0x08000048 ldr x1, [x0, 0x7ff8] ; [0x7ff8:4]=-1; RELOC 0 global2 @ 0x00000008
EOF
RUN

View file

@ -72,48 +72,48 @@ EXPECT=<<EOF
0x000b58c6 = 0x00 [LE]
0x000b58c7 = 0x00 [LE]
;-- section..init_array:
;-- .datadiv_decode1794556967687044894:
;-- reloc..datadiv_decode1794556967687044894:
0x000b58c4 .dword 0x00004561 ; reloc.target..datadiv_decode1794556967687044894 ; sym..datadiv_decode1794556967687044894; RELOC 32 .datadiv_decode1794556967687044894 @ 0x00004560 + 0x1 ; [14] -rw- section size 364 named .init_array
---
0x000b58d8 = 0x45 [LE]
0x000b58d9 = 0x8b [LE]
0x000b58da = 0x09 [LE]
0x000b58db = 0x00 [LE]
;-- .datadiv_decode668687990735969933:
;-- reloc..datadiv_decode668687990735969933:
0x000b58d8 .dword 0x00098b45 ; reloc.target..datadiv_decode668687990735969933 ; sym..datadiv_decode668687990735969933; RELOC 32 .datadiv_decode668687990735969933 @ 0x00098b44 + 0x1
---
0x000b5dbc = 0x24 [LE]
0x000b5dbd = 0x35 [LE]
0x000b5dbe = 0x14 [LE]
0x000b5dbf = 0x00 [LE]
;-- x.10:
;-- reloc.x.10:
0x000b5dbc .dword 0x00143524 ; reloc.target.x.10 ; obj.x.10; RELOC 32 x.10 @ 0x00143524
---
0x000b5e08 = 0xb4 [LE]
0x000b5e09 = 0x37 [LE]
0x000b5e0a = 0x14 [LE]
0x000b5e0b = 0x00 [LE]
;-- __cxa_atexit:
;-- reloc.__cxa_atexit:
0x000b5e08 .dword 0x001437b4 ; reloc.target.__cxa_atexit; RELOC 32 __cxa_atexit
---
;-- section..init_array:
;-- .datadiv_decode1794556967687044894:
;-- reloc..datadiv_decode1794556967687044894:
0x000b58c4 .dword 0x00004561 ; reloc.target..datadiv_decode1794556967687044894 ; sym..datadiv_decode1794556967687044894; RELOC 32 .datadiv_decode1794556967687044894 @ 0x00004560 + 0x1 ; [14] -rw- section size 364 named .init_array
;-- .datadiv_decode12875440098136793118:
;-- reloc..datadiv_decode12875440098136793118:
0x000b58c8 .dword 0x00004571 ; reloc.target..datadiv_decode12875440098136793118 ; sym..datadiv_decode12875440098136793118; RELOC 32 .datadiv_decode12875440098136793118 @ 0x00004570 + 0x1
;-- .datadiv_decode11893604691534341392:
;-- reloc..datadiv_decode11893604691534341392:
0x000b58cc .dword 0x00098029 ; reloc.target..datadiv_decode11893604691534341392 ; sym..datadiv_decode11893604691534341392; RELOC 32 .datadiv_decode11893604691534341392 @ 0x00098028 + 0x1
0x000b58d0 .dword 0x00008115 ; entry.init0 ; RELOC 32
0x000b58d4 .dword 0x00055049 ; entry.init1 ; RELOC 32
;-- .datadiv_decode668687990735969933:
;-- reloc..datadiv_decode668687990735969933:
0x000b58d8 .dword 0x00098b45 ; reloc.target..datadiv_decode668687990735969933 ; sym..datadiv_decode668687990735969933; RELOC 32 .datadiv_decode668687990735969933 @ 0x00098b44 + 0x1
;-- .datadiv_decode16868916699024037624:
;-- reloc..datadiv_decode16868916699024037624:
0x000b58dc .dword 0x00098b49 ; reloc.target..datadiv_decode16868916699024037624 ; sym..datadiv_decode16868916699024037624; RELOC 32 .datadiv_decode16868916699024037624 @ 0x00098b48 + 0x1
;-- .datadiv_decode12802097292201864397:
;-- reloc..datadiv_decode12802097292201864397:
0x000b58e0 .dword 0x00098b4d ; reloc.target..datadiv_decode12802097292201864397 ; sym..datadiv_decode12802097292201864397; RELOC 32 .datadiv_decode12802097292201864397 @ 0x00098b4c + 0x1
;-- .datadiv_decode12428479046606065387:
;-- reloc..datadiv_decode12428479046606065387:
0x000b58e4 .dword 0x00098b51 ; reloc.target..datadiv_decode12428479046606065387 ; sym..datadiv_decode12428479046606065387; RELOC 32 .datadiv_decode12428479046606065387 @ 0x00098b50 + 0x1
;-- .datadiv_decode7496105736011033460:
;-- reloc..datadiv_decode7496105736011033460:
0x000b58e8 .dword 0x00098b55 ; reloc.target..datadiv_decode7496105736011033460 ; sym..datadiv_decode7496105736011033460; RELOC 32 .datadiv_decode7496105736011033460 @ 0x00098b54 + 0x1
EOF
RUN
@ -133,7 +133,7 @@ EXPECT=<<EOF
0x08000b83 = 0xf0 [LE]
0x08000b84 = 0xe7 [LE]
0x08000b85 = 0xfc [LE]
;-- memset:
;-- reloc.memset.8000b82:
0x08000b82 bl reloc.target.memset ; RELOC 24 memset
EOF
RUN
@ -149,23 +149,23 @@ EXPECT=<<EOF
320
;-- section..init_array:
;-- segment.LOAD1:
;-- .datadiv_decode9958896245423089702:
;-- reloc..datadiv_decode9958896245423089702:
0x00126510 .qword 0x0000000000005a6c ; reloc.target..datadiv_decode9958896245423089702 ; sym..datadiv_decode9958896245423089702; RELOC 64 .datadiv_decode9958896245423089702 @ 0x00005a6c ; [12] -rw- section size 728 named .init_array
;-- .datadiv_decode10476194973746341988:
;-- reloc..datadiv_decode10476194973746341988:
0x00126518 .qword 0x0000000000005a80 ; reloc.target..datadiv_decode10476194973746341988 ; sym..datadiv_decode10476194973746341988; RELOC 64 .datadiv_decode10476194973746341988 @ 0x00005a80
;-- .datadiv_decode16323044921667855934:
;-- reloc..datadiv_decode16323044921667855934:
0x00126520 .qword 0x00000000000efddc ; reloc.target..datadiv_decode16323044921667855934 ; sym..datadiv_decode16323044921667855934; RELOC 64 .datadiv_decode16323044921667855934 @ 0x000efddc
0x00126528 .qword 0x0000000000009080 ; entry.init0 ; RELOC 64
0x00126530 .qword 0x0000000000077d14 ; entry.init1 ; RELOC 64
;-- .datadiv_decode667225052219618748:
;-- reloc..datadiv_decode667225052219618748:
0x00126538 .qword 0x00000000000f22e0 ; reloc.target..datadiv_decode667225052219618748 ; sym..datadiv_decode667225052219618748; RELOC 64 .datadiv_decode667225052219618748 @ 0x000f22e0
;-- .datadiv_decode8132880250332170398:
;-- reloc..datadiv_decode8132880250332170398:
0x00126540 .qword 0x00000000000f22e4 ; reloc.target..datadiv_decode8132880250332170398 ; sym..datadiv_decode8132880250332170398; RELOC 64 .datadiv_decode8132880250332170398 @ 0x000f22e4
;-- .datadiv_decode3655886617018729963:
;-- reloc..datadiv_decode3655886617018729963:
0x00126548 .qword 0x00000000000f22e8 ; reloc.target..datadiv_decode3655886617018729963 ; sym..datadiv_decode3655886617018729963; RELOC 64 .datadiv_decode3655886617018729963 @ 0x000f22e8
;-- .datadiv_decode16406252260792032531:
;-- reloc..datadiv_decode16406252260792032531:
0x00126550 .qword 0x00000000000f22ec ; reloc.target..datadiv_decode16406252260792032531 ; sym..datadiv_decode16406252260792032531; RELOC 64 .datadiv_decode16406252260792032531 @ 0x000f22ec
;-- .datadiv_decode13403071575248320347:
;-- reloc..datadiv_decode13403071575248320347:
0x00126558 .qword 0x00000000000f22f0 ; reloc.target..datadiv_decode13403071575248320347 ; sym..datadiv_decode13403071575248320347; RELOC 64 .datadiv_decode13403071575248320347 @ 0x000f22f0
EOF
RUN
@ -249,7 +249,7 @@ EXPECT=<<EOF
1
0x08000038 = 0x0090 [LE]
;-- section..data:
;-- foo:
;-- reloc.foo:
;-- .data:
;-- reloc_slot:
0x08000038 .dword 0x00000090 ; RELOC 32 foo ; [02] -rw- section size 4 named .data
@ -268,12 +268,12 @@ EXPECT=<<EOF
0x08000038 0x00000038 0x08000034 R_ARM_CALL foo - 0x08000040
0x0800003c 0x0000003c 0x08000034 R_ARM_JUMP24 foo - 0x08000044
0x08000040 0x00000040 0x08000034 R_ARM_CALL foo - 0x08000048
;-- foo:
;-- reloc.foo:
;-- arm:
0x08000038 bl foo ; RELOC 24 foo @ 0x08000034 - 0x8000040
;-- foo:
;-- reloc.foo.800003c:
0x0800003c bl foo ; RELOC 24 foo @ 0x08000034 - 0x8000044
;-- foo:
;-- reloc.foo.8000040:
0x08000040 blx foo ; RELOC 24 foo @ 0x08000034 - 0x8000048
EOF
RUN
@ -313,26 +313,26 @@ EXPECT=<<EOF
;-- section..text.0:
;-- section..text.2:
;-- section..text.1:
;-- dat1:
;-- reloc.dat1:
;-- _start:
0x08000034 add r0, pc, 0xff000 ; RELOC 32 dat1 @ 0x08100034 - 0x800003c ; [05] -r-x section size 76 named .text.1
;-- dat1:
;-- reloc.dat1.8000038:
0x08000038 add r0, r0, 0xff0 ; RELOC 32 dat1 @ 0x08100034 - 0x800003c
;-- dat1:
;-- reloc.dat1.800003c:
0x0800003c add r0, r0, 8 ; RELOC 32 dat1 @ 0x08100034 - 0x800003c
;-- dat2:
;-- reloc.dat2.8000058:
0x08000058 add r0, pc, 240, 12 ; RELOC 32 dat2 @ 0x170f0034 - 0x8000060
;-- dat2:
;-- reloc.dat2.800005c:
0x0800005c add r0, r0, 0xef000 ; RELOC 32 dat2 @ 0x170f0034 - 0x8000060
;-- dat2:
;-- reloc.dat2.8000060:
0x08000060 ldr r0, [r0, 0xfd4] ; RELOC 32 dat2 @ 0x170f0034 - 0x8000060
;-- dat1:
;-- reloc.dat1.8000064:
0x08000064 add r0, pc, 0xff000 ; RELOC 32 dat1 @ 0x08100034 - 0x800006c
;-- dat1:
;-- reloc.dat1.8000068:
0x08000068 ldr r0, [r0, 0xfc8] ; RELOC 32 dat1 @ 0x08100034 - 0x800006c
;-- dat1:
;-- reloc.dat1.8000078:
0x08000078 add r0, pc, 0xff000 ; RELOC 32 dat1 @ 0x08100034 - 0x8000080
;-- dat1:
;-- reloc.dat1.800007c:
0x0800007c ldrd r0, r1, [r0, 0xb4] ; RELOC 32 dat1 @ 0x08100034 - 0x8000080
EOF
RUN
@ -349,7 +349,7 @@ EXPECT=<<EOF
-------------------------------------------------------------
0x000011c4 0x000001c4 0x000011d0 R_ARM_JUMP_SLOT target_func
0x000011c4 = 0x11d0 [LE]
;-- target_func:
;-- reloc.target_func:
0x000011c4 .dword 0x000011d0 ; reloc.target.target_func; RELOC 32 target_func
EOF
RUN
@ -430,71 +430,71 @@ EXPECT=<<EOF
0x08001b10 0x00001b10 0x08020000 R_ARM_MOVT_BREL label3.4 - 0x08000000
;-- section..text:
;-- section..R_ARM_MOVW_ABS_NC:
;-- label:
;-- reloc.label:
;-- _start:
0x08001000 movw r0, 0 ; RELOC 32 label @ 0x08010000 ; [03] -r-x section size 20 named .R_ARM_MOVW_ABS_NC
;-- label1:
;-- reloc.label1:
0x08001004 movw r1, 4 ; RELOC 32 label1 @ 0x08010004
;-- label2:
;-- reloc.label2:
0x08001008 movw r2, 0xc ; RELOC 32 label2 @ 0x08010008 + 0x4
;-- label3:
;-- reloc.label3:
0x0800100c movw r3, 0xfffc ; RELOC 32 label3 @ 0x0801fffc
;-- label3:
;-- reloc.label3.8001010:
0x08001010 movw r4, 0 ; RELOC 32 label3 @ 0x0801fffc + 0x4
;-- section..R_ARM_MOVT_ABS:
;-- label:
;-- reloc.label.8001100:
0x08001100 movt r0, 0x801 ; RELOC 32 label @ 0x08010000 ; [05] -r-x section size 20 named .R_ARM_MOVT_ABS
;-- label1:
;-- reloc.label1.8001104:
0x08001104 movt r1, 0x801 ; RELOC 32 label1 @ 0x08010004
;-- label2:
;-- reloc.label2.8001108:
0x08001108 movt r2, 0x801 ; RELOC 32 label2 @ 0x08010008 + 0x4
;-- label3:
;-- reloc.label3.800110c:
0x0800110c movt r3, 0x801 ; RELOC 32 label3 @ 0x0801fffc
;-- label3:
;-- reloc.label3.8001110:
0x08001110 movt r4, 0x802 ; RELOC 32 label3 @ 0x0801fffc + 0x4
;-- section..R_ARM_MOVW_PREL_NC:
;-- label:
;-- reloc.label.8001200:
0x08001200 movw r0, 0xee00 ; RELOC 32 label @ 0x08010000 - 0x8001200 ; [07] -r-x section size 20 named .R_ARM_MOVW_PREL_NC
;-- label1:
;-- reloc.label1.8001204:
0x08001204 movw r1, 0xee00 ; RELOC 32 label1 @ 0x08010004 - 0x8001204
;-- label2:
;-- reloc.label2.8001208:
0x08001208 movw r2, 0xee04 ; RELOC 32 label2 @ 0x08010008 - 0x8001204
;-- label3:
;-- reloc.label3.800120c:
0x0800120c movw r3, 0xedf0 ; RELOC 32 label3 @ 0x0801fffc - 0x800120c
;-- label3:
;-- reloc.label3.8001210:
0x08001210 movw r4, 0x1000 ; RELOC 32 label3 @ 0x0801fffc - 0x7ffeffc
;-- section..R_ARM_MOVT_PREL:
;-- label:
;-- reloc.label.8001300:
0x08001300 movt r0, 0x801 ; RELOC 32 label @ 0x08010000 - 0x8001300 ; [09] -r-x section size 20 named .R_ARM_MOVT_PREL
;-- label1:
;-- reloc.label1.8001304:
0x08001304 movt r1, 0x801 ; RELOC 32 label1 @ 0x08010004 - 0x8001304
;-- label2:
;-- reloc.label2.8001308:
0x08001308 movt r2, 0x801 ; RELOC 32 label2 @ 0x08010008 - 0x8001304
;-- label3:
;-- reloc.label3.800130c:
0x0800130c movt r3, 0x801 ; RELOC 32 label3 @ 0x0801fffc - 0x800130c
;-- label3:
;-- reloc.label3.8001310:
0x08001310 movt r4, 0x802 ; RELOC 32 label3 @ 0x0801fffc - 0x7ffeffc
;-- section..R_ARM_MOVW_BREL_NC:
;-- label:
;-- reloc.label.8001400:
0x08001400 movw r0, 0 ; RELOC 16 label @ 0x08010000 - 0x8000000 ; [11] -r-x section size 20 named .R_ARM_MOVW_BREL_NC
;-- label1:
;-- reloc.label1.8001404:
0x08001404 movw r1, 4 ; RELOC 16 label1 @ 0x08010004 - 0x8000000
;-- label2:
;-- reloc.label2.8001408:
0x08001408 movw r2, 8 ; RELOC 16 label2 @ 0x08010008 - 0x8000000
;-- label3:
;-- reloc.label3.800140c:
0x0800140c movw r3, 0xfffc ; RELOC 16 label3 @ 0x0801fffc - 0x8000000
;-- label3.4:
;-- reloc.label3.4:
0x08001410 movw r4, 0 ; RELOC 16 label3.4 @ 0x08020000 - 0x8000000
;-- section..R_ARM_MOVT_BREL:
;-- label:
;-- reloc.label.8001500:
0x08001500 movt r0, 1 ; RELOC 32 label @ 0x08010000 - 0x8000000 ; [13] -r-x section size 20 named .R_ARM_MOVT_BREL
;-- label1:
;-- reloc.label1.8001504:
0x08001504 movt r1, 1 ; RELOC 32 label1 @ 0x08010004 - 0x8000000
;-- label2:
;-- reloc.label2.8001508:
0x08001508 movt r2, 1 ; RELOC 32 label2 @ 0x08010008 - 0x8000000
;-- label3:
;-- reloc.label3.800150c:
0x0800150c movt r3, 1 ; RELOC 32 label3 @ 0x0801fffc - 0x8000000
;-- label3.4:
;-- reloc.label3.4.8001510:
0x08001510 movt r4, 2 ; RELOC 32 label3.4 @ 0x08020000 - 0x8000000
EOF
RUN
@ -574,70 +574,70 @@ EXPECT=<<EOF
0x08001b0c 0x00001b0c 0x0801fffc R_ARM_THM_MOVT_BREL label3 - 0x08000000
0x08001b10 0x00001b10 0x08020000 R_ARM_THM_MOVT_BREL label3.4 - 0x08000000
;-- section..R_ARM_THM_MOVW_ABS_NC:
;-- label:
;-- reloc.label.8001600:
0x08001600 movw r0, 0 ; RELOC 32 label @ 0x08010000 ; [15] -r-x section size 20 named .R_ARM_THM_MOVW_ABS_NC
;-- label1:
;-- reloc.label1.8001604:
0x08001604 movw r1, 4 ; RELOC 32 label1 @ 0x08010004
;-- label2:
;-- reloc.label2.8001608:
0x08001608 movw r2, 0xc ; RELOC 32 label2 @ 0x08010008 + 0x4
;-- label3:
;-- reloc.label3.800160c:
0x0800160c movw r3, 0xfffc ; RELOC 32 label3 @ 0x0801fffc
;-- label3:
;-- reloc.label3.8001610:
0x08001610 movw r4, 0 ; RELOC 32 label3 @ 0x0801fffc + 0x4
;-- section..R_ARM_THM_MOVT_ABS:
;-- label:
;-- reloc.label.8001700:
0x08001700 movt r0, 0x801 ; RELOC 32 label @ 0x08010000 ; [17] -r-x section size 20 named .R_ARM_THM_MOVT_ABS
;-- label1:
;-- reloc.label1.8001704:
0x08001704 movt r1, 0x801 ; RELOC 32 label1 @ 0x08010004
;-- label2:
;-- reloc.label2.8001708:
0x08001708 movt r2, 0x805 ; RELOC 32 label2 @ 0x08010008 + 0x40000
;-- label3:
;-- reloc.label3.800170c:
0x0800170c movt r3, 0x801 ; RELOC 32 label3 @ 0x0801fffc
;-- label3:
;-- reloc.label3.8001710:
0x08001710 movt r4, 0x805 ; RELOC 32 label3 @ 0x0801fffc + 0x40000
;-- section..R_ARM_THM_MOVW_PREL_NC:
;-- label:
;-- reloc.label.8001800:
0x08001800 movw r0, 0xe800 ; RELOC 32 label @ 0x08010000 - 0x8001800 ; [19] -r-x section size 20 named .R_ARM_THM_MOVW_PREL_NC
;-- label1:
;-- reloc.label1.8001804:
0x08001804 movw r1, 0xe800 ; RELOC 32 label1 @ 0x08010004 - 0x8001804
;-- label2:
;-- reloc.label2.8001808:
0x08001808 movw r2, 0xe804 ; RELOC 32 label2 @ 0x08010008 - 0x8001804
;-- label3:
;-- reloc.label3.800180c:
0x0800180c movw r3, 0xe7f0 ; RELOC 32 label3 @ 0x0801fffc - 0x800180c
;-- label3:
;-- reloc.label3.8001810:
0x08001810 movw r4, 0xfa00 ; RELOC 32 label3 @ 0x0801fffc - 0x80005fc
;-- section..R_ARM_THM_MOVT_PREL:
;-- label:
;-- reloc.label.8001900:
0x08001900 movt r0, 0 ; RELOC 32 label @ 0x08010000 - 0x8001900 ; [21] -r-x section size 20 named .R_ARM_THM_MOVT_PREL
;-- label1:
;-- reloc.label1.8001904:
0x08001904 movt r1, 0 ; RELOC 32 label1 @ 0x08010004 - 0x8001904
;-- label2:
;-- reloc.label2.8001908:
0x08001908 movt r2, 4 ; RELOC 32 label2 @ 0x08010008 - 0x7fc1908
;-- label3:
;-- reloc.label3.800190c:
0x0800190c movt r3, 1 ; RELOC 32 label3 @ 0x0801fffc - 0x800190c
;-- label3:
;-- reloc.label3.8001910:
0x08001910 movt r4, 0x2915 ; RELOC 32 label3 @ 0x0801fffc + 0x2113e6f0
;-- section..R_ARM_THM_MOVW_BREL_NC:
;-- label:
;-- reloc.label.8001a00:
0x08001a00 movw r0, 0 ; RELOC 32 label @ 0x08010000 - 0x8000000 ; [23] -r-x section size 20 named .R_ARM_THM_MOVW_BREL_NC
;-- label1:
;-- reloc.label1.8001a04:
0x08001a04 movw r1, 4 ; RELOC 32 label1 @ 0x08010004 - 0x8000000
;-- label2:
;-- reloc.label2.8001a08:
0x08001a08 movw r2, 8 ; RELOC 32 label2 @ 0x08010008 - 0x8000000
;-- label3:
;-- reloc.label3.8001a0c:
0x08001a0c movw r3, 0xfffc ; RELOC 32 label3 @ 0x0801fffc - 0x8000000
;-- label3.4:
;-- reloc.label3.4.8001a10:
0x08001a10 movw r4, 0 ; RELOC 32 label3.4 @ 0x08020000 - 0x8000000
;-- section..R_ARM_THM_MOVT_BREL:
;-- label:
;-- reloc.label.8001b00:
0x08001b00 movt r0, 1 ; RELOC 32 label @ 0x08010000 - 0x8000000 ; [25] -r-x section size 20 named .R_ARM_THM_MOVT_BREL
;-- label1:
;-- reloc.label1.8001b04:
0x08001b04 movt r1, 1 ; RELOC 32 label1 @ 0x08010004 - 0x8000000
;-- label2:
;-- reloc.label2.8001b08:
0x08001b08 movt r2, 1 ; RELOC 32 label2 @ 0x08010008 - 0x8000000
;-- label3:
;-- reloc.label3.8001b0c:
0x08001b0c movt r3, 1 ; RELOC 32 label3 @ 0x0801fffc - 0x8000000
;-- label3.4:
;-- reloc.label3.4.8001b10:
0x08001b10 movt r4, 2 ; RELOC 32 label3.4 @ 0x08020000 - 0x8000000
EOF
RUN
@ -746,7 +746,7 @@ EXPECT=<<EOF
-------------------------------------------------------------------
0x08000034 0x00000034 0x0800012c R_ARM_THM_JUMP24 foo - 0x08000038
;-- section..text:
;-- foo:
;-- reloc.foo:
;-- .text:
;-- _start:
,=< 0x08000034 b.w reloc.target.foo ; RELOC 24 foo ; [01] -r-x section size 4 named .text

View file

@ -200,40 +200,40 @@ EXPECT=<<EOF
0x08000f00 .qword 0x0000000000000000 ; RELOC TARGET 32 strcmp
--
0x08000040 4 .text
0x08000073 4 .rodata.str1.1
0x0800007a 4 strcmp
0x0800009c 4 .rodata.str1.1
0x080000a3 4 strcmp
0x080000be 4 .rodata.str1.1
0x080000c5 4 strcmp
0x080000f8 8 .rodata.str1.1
0x08000125 4 stat
0x08000144 4 strlen
0x08000199 4 memcpy
0x080001be 8 .rodata.str1.1
0x080001e0 4 strlen
0x08000231 4 memcpy
0x08000267 4 memcpy
0x080002a2 4 perror
0x080002c9 4 time
0x080003a9 4 .rodata.str1.1
0x080003b8 4 .L.str.5
0x0800050f 8 .rodata.str1.1
0x0800053e 8 .rodata.str1.1
0x08000555 4 exit
0x0800057f 4 write
0x080005be 4 utilvserver_fmt_ulong_base
0x080005f5 4 strlen
0x0800061b 8 .rodata.str1.1
0x08000632 4 exit
0x08000073 4 reloc..rodata.str1.1
0x0800007a 4 reloc.strcmp
0x0800009c 4 reloc..rodata.str1.1.800009c
0x080000a3 4 reloc.strcmp.80000a3
0x080000be 4 reloc..rodata.str1.1.80000be
0x080000c5 4 reloc.strcmp.80000c5
0x080000f8 8 reloc..rodata.str1.1.80000f8
0x08000125 4 reloc.stat
0x08000144 4 reloc.strlen
0x08000199 4 reloc.memcpy
0x080001be 8 reloc..rodata.str1.1.80001be
0x080001e0 4 reloc.strlen.80001e0
0x08000231 4 reloc.memcpy.8000231
0x08000267 4 reloc.memcpy.8000267
0x080002a2 4 reloc.perror
0x080002c9 4 reloc.time
0x080003a9 4 reloc..rodata.str1.1.80003a9
0x080003b8 4 reloc..L.str.5
0x0800050f 8 reloc..rodata.str1.1.800050f
0x0800053e 8 reloc..rodata.str1.1.800053e
0x08000555 4 reloc.exit
0x0800057f 4 reloc.write
0x080005be 4 reloc.utilvserver_fmt_ulong_base
0x080005f5 4 reloc.strlen.80005f5
0x0800061b 8 reloc..rodata.str1.1.800061b
0x08000632 4 reloc.exit.8000632
0x08000636 4 .rodata.str1.1
0x08000689 4 .L.str.5
0x08000880 4 .text
0x0800089c 4 .text
0x080008b8 4 .text
0x080008d4 4 .text
0x080008f0 4 .text
0x0800090c 4 .text
0x08000880 4 reloc..text
0x0800089c 4 reloc..text.800089c
0x080008b8 4 reloc..text.80008b8
0x080008d4 4 reloc..text.80008d4
0x080008f0 4 reloc..text.80008f0
0x0800090c 4 reloc..text.800090c
0x08000f00 4 strcmp
0x08000f08 4 stat
0x08000f10 4 strlen
@ -478,3 +478,45 @@ EXPECT=<<EOF
0x001e0098 0x000e0098 R_PPC64_IRELATIVE 0x001789c0
EOF
RUN
NAME=asm.flag.real reloc flags (non-reloc file)
FILE=bins/elf/_Exit_0x91
CMDS=<<EOF
e asm.flags.real=0
fl~_Exit
echo
e asm.flags.real=1
fl~_Exit
EOF
EXPECT=<<EOF
0x00001020 16 sym.imp._Exit
0x00003ff8 8 reloc._Exit
0x00004008 8 reloc.target._Exit
0x00001020 16 _Exit
0x00003ff8 8 reloc._Exit
0x00004008 8 reloc.target._Exit
EOF
RUN
NAME=asm.flag.real reloc flags (reloc file)
FILE=bins/elf/test.ko
CMDS=<<EOF
e asm.flags.real=0
fl~printk
echo
e asm.flags.real=1
fl~printk
EOF
EXPECT=<<EOF
0x0800008d 4 reloc.printk
0x080000a0 4 reloc.printk.80000a0
0x080000b4 4 reloc.printk.80000b4
0x08000b20 4 reloc.target.printk
0x0800008d 4 reloc.printk
0x080000a0 4 reloc.printk.80000a0
0x080000b4 4 reloc.printk.80000b4
0x08000b20 4 printk
EOF
RUN

View file

@ -43,47 +43,47 @@ pd 21
EOF
EXPECT=<<EOF
;-- section..text:
;-- foo:
;-- reloc.foo:
;-- $x.0:
;-- _start:
0x08000034 lui a0, 0x8000 ; RELOC 0 foo @ 0x08000088 ; [02] -r-x section size 84 named .text
;-- foo:
;-- reloc.foo.8000038:
0x08000038 addi a0, a0, 0x88 ; RELOC 0 foo @ 0x08000088
;-- foo:
;-- reloc.foo.800003c:
0x0800003c lw a0, 0x88(a0) ; RELOC 0 foo @ 0x08000088
;-- foo:
;-- reloc.foo.8000040:
0x08000040 sw a0, 0x88(a0) ; RELOC 0 foo @ 0x08000088
;-- bar:
;-- reloc.bar:
0x08000044 lui a0, 0x8001 ; RELOC 0 bar @ 0x08001087
;-- bar:
;-- reloc.bar.8000048:
0x08000048 addi a0, a0, 0x87 ; RELOC 0 bar @ 0x08001087
;-- bar:
;-- reloc.bar.800004c:
0x0800004c lb a0, 0x87(a0) ; RELOC 0 bar @ 0x08001087
;-- bar:
;-- reloc.bar.8000050:
0x08000050 sb a0, 0x87(a0) ; RELOC 0 bar @ 0x08001087
;-- norelax:
;-- reloc.norelax:
0x08000054 lui a0, 0x8001 ; RELOC 0 norelax @ 0x08001088
;-- norelax:
;-- reloc.norelax.8000058:
0x08000058 addi a0, a0, 0x88 ; RELOC 0 norelax @ 0x08001088
;-- norelax:
;-- reloc.norelax.800005c:
0x0800005c lw a0, 0x88(a0) ; RELOC 0 norelax @ 0x08001088
;-- norelax:
;-- reloc.norelax.8000060:
0x08000060 sw a0, 0x88(a0) ; RELOC 0 norelax @ 0x08001088
;-- undefined_weak:
;-- reloc.undefined_weak:
0x08000064 lui a0, 0x8001 ; RELOC 0 undefined_weak
;-- undefined_weak:
;-- reloc.undefined_weak.8000068:
0x08000068 addi a0, a0, 0x27c ; RELOC 0 undefined_weak
;-- undefined_weak:
;-- reloc.undefined_weak.800006c:
0x0800006c lw a0, 0x27c(a0) ; RELOC 0 undefined_weak
;-- undefined_weak:
;-- reloc.undefined_weak.8000070:
0x08000070 sw a0, 0x27c(a0) ; RELOC 0 undefined_weak
;-- baz:
;-- reloc.baz:
0x08000074 lui a0, 0x8001 ; RELOC 0 baz
;-- baz:
;-- reloc.baz.8000078:
0x08000078 addi a0, a0, 0x280 ; RELOC 0 baz
;-- baz:
;-- reloc.baz.800007c:
0x0800007c lw a0, 0x280(a0) ; RELOC 0 baz
;-- baz:
;-- reloc.baz.8000080:
0x08000080 sw a0, 0x280(a0) ; RELOC 0 baz
;-- a:
0x08000084 addi a0, a0, 1
@ -97,47 +97,47 @@ pd 21
EOF
EXPECT=<<EOF
;-- section..text:
;-- foo:
;-- reloc.foo:
;-- $x.0:
;-- _start:
0x08000040 lui a0, 0x8000 ; RELOC 0 foo @ 0x08000094 ; [02] -r-x section size 84 named .text
;-- foo:
;-- reloc.foo.8000044:
0x08000044 addi a0, a0, 0x94 ; RELOC 0 foo @ 0x08000094
;-- foo:
;-- reloc.foo.8000048:
0x08000048 lw a0, 0x94(a0) ; RELOC 0 foo @ 0x08000094
;-- foo:
;-- reloc.foo.800004c:
0x0800004c sw a0, 0x94(a0) ; RELOC 0 foo @ 0x08000094
;-- bar:
;-- reloc.bar:
0x08000050 lui a0, 0x8001 ; RELOC 0 bar @ 0x08001093
;-- bar:
;-- reloc.bar.8000054:
0x08000054 addi a0, a0, 0x93 ; RELOC 0 bar @ 0x08001093
;-- bar:
;-- reloc.bar.8000058:
0x08000058 lb a0, 0x93(a0) ; RELOC 0 bar @ 0x08001093
;-- bar:
;-- reloc.bar.800005c:
0x0800005c sb a0, 0x93(a0) ; RELOC 0 bar @ 0x08001093
;-- norelax:
;-- reloc.norelax:
0x08000060 lui a0, 0x8001 ; RELOC 0 norelax @ 0x08001094
;-- norelax:
;-- reloc.norelax.8000064:
0x08000064 addi a0, a0, 0x94 ; RELOC 0 norelax @ 0x08001094
;-- norelax:
;-- reloc.norelax.8000068:
0x08000068 lw a0, 0x94(a0) ; RELOC 0 norelax @ 0x08001094
;-- norelax:
;-- reloc.norelax.800006c:
0x0800006c sw a0, 0x94(a0) ; RELOC 0 norelax @ 0x08001094
;-- undefined_weak:
;-- reloc.undefined_weak:
0x08000070 lui a0, 0x8001 ; RELOC 0 undefined_weak
;-- undefined_weak:
;-- reloc.undefined_weak.8000074:
0x08000074 addi a0, a0, 0x3c8 ; RELOC 0 undefined_weak
;-- undefined_weak:
;-- reloc.undefined_weak.8000078:
0x08000078 lw a0, 0x3c8(a0) ; RELOC 0 undefined_weak
;-- undefined_weak:
;-- reloc.undefined_weak.800007c:
0x0800007c sw a0, 0x3c8(a0) ; RELOC 0 undefined_weak
;-- baz:
;-- reloc.baz:
0x08000080 lui a0, 0x8001 ; RELOC 0 baz
;-- baz:
;-- reloc.baz.8000084:
0x08000084 addi a0, a0, 0x3d0 ; RELOC 0 baz
;-- baz:
;-- reloc.baz.8000088:
0x08000088 lw a0, 0x3d0(a0) ; RELOC 0 baz
;-- baz:
;-- reloc.baz.800008c:
0x0800008c sw a0, 0x3d0(a0) ; RELOC 0 baz
;-- a:
0x08000090 addi a0, a0, 1
@ -154,13 +154,13 @@ ir
EOF
EXPECT=<<EOF
;-- section..text:
;-- foo:
;-- reloc.foo:
;-- bar:
;-- $x.0:
;-- _start:
,=< 0x08000034 j loc.foo ; RELOC 0 foo @ 0x08000038 ; [02] -r-x section size 8 named .text
| ;-- foo:
| ;-- bar:
| ;-- reloc.bar:
`-> 0x08000038 jal loc._x.0 ; RELOC 0 bar @ 0x08000034
nth paddr vaddr bind type size lib name
--------------------------------------------------------
@ -184,13 +184,13 @@ ir
EOF
EXPECT=<<EOF
;-- section..text:
;-- foo:
;-- reloc.foo:
;-- bar:
;-- $x.0:
;-- _start:
,=< 0x08000040 j loc.foo ; RELOC 0 foo @ 0x08000044 ; [02] -r-x section size 8 named .text
| ;-- foo:
| ;-- bar:
| ;-- reloc.bar:
`-> 0x08000044 jal loc._x.0 ; RELOC 0 bar @ 0x08000040
nth paddr vaddr bind type size lib name
--------------------------------------------------------
@ -214,11 +214,11 @@ is
ir
EOF
EXPECT=<<EOF
;-- foo:
;-- reloc.foo:
;-- $x.0:
;-- _start:
,=< 0x08100034 j loc.foo ; RELOC 0 foo @ 0x08200032
| ;-- bar:
| ;-- reloc.bar:
| 0x08100038 jal loc.bar ; RELOC 0 bar @ 0x08000038
nth paddr vaddr bind type size lib name
--------------------------------------------------------
@ -242,11 +242,11 @@ is
ir
EOF
EXPECT=<<EOF
;-- foo:
;-- reloc.foo:
;-- $x.0:
;-- _start:
,=< 0x08100040 j loc.foo ; RELOC 0 foo @ 0x0820003e
| ;-- bar:
| ;-- reloc.bar:
| 0x08100044 jal loc.bar ; RELOC 0 bar @ 0x08000044
nth paddr vaddr bind type size lib name
--------------------------------------------------------
@ -273,7 +273,7 @@ EXPECT=<<EOF
;-- $x.0:
;-- test:
0x08000034 li a1, 3 ; [02] -r-x section size 14 named .text
;-- .LBB0_2:
;-- reloc..LBB0_2:
,=< 0x08000036 bltu a0, a1, loc..LBB0_2 ; RELOC 0 .LBB0_2 @ 0x0800003e
| 0x0800003a li a0, 4
| 0x0800003c ret
@ -306,7 +306,7 @@ EXPECT=<<EOF
;-- $x.0:
;-- test:
0x08000040 li a1, 3 ; [02] -r-x section size 14 named .text
;-- .LBB0_2:
;-- reloc..LBB0_2:
,=< 0x08000042 bltu a0, a1, loc..LBB0_2 ; RELOC 0 .LBB0_2 @ 0x0800004a
| 0x08000046 li a0, 4
| 0x08000048 ret
@ -340,7 +340,7 @@ ir
EOF
EXPECT=<<EOF
;-- section..text:
;-- .LBB0_2:
;-- reloc..LBB0_2:
;-- test_forward_max:
/ loc._x.0();
| ,=< 0x08000034 beqz a0, loc..LBB0_2 ; RELOC 0 .LBB0_2 @ 0x08001032 ; [02] -r-x section size 16412 named .text
@ -384,7 +384,7 @@ ir
EOF
EXPECT=<<EOF
;-- section..text:
;-- .LBB0_2:
;-- reloc..LBB0_2:
;-- test_forward_max:
/ loc._x.0();
| ,=< 0x08000040 beqz a0, loc..LBB0_2 ; RELOC 0 .LBB0_2 @ 0x0800103e ; [02] -r-x section size 16412 named .text
@ -520,16 +520,16 @@ EXPECT=<<EOF
| 0x0800003a addi s0, sp, 0x10
| 0x0800003c li a0, 0
| 0x0800003e sw a0, -0xc(s0)
| ;-- ptr:
| ;-- reloc.ptr:
| 0x08000042 lui a0, 0x8000 ; 0x8000000
| ; segment.ehdr; RELOC 0
| ;-- ptr:
| ;-- reloc.ptr.8000046:
| 0x08000046 lw a0, 0x68(a0) ; RELOC 0
| 0x0800004a lw a0, 0(a0)
| ;-- ptr32:
| ;-- reloc.ptr32:
| 0x0800004c lui a1, 0x8000 ; 0x8000000
| ; segment.ehdr; RELOC 0
| ;-- ptr32:
| ;-- reloc.ptr32.8000050:
| 0x08000050 lw a1, 0x64(a1) ; RELOC 0
| 0x08000054 lw a1, 0(a1)
| 0x08000056 add a0, a0, a1
@ -584,17 +584,17 @@ EXPECT=<<EOF
| 0x08000042 sd ra, 8(sp)
| 0x08000044 sd s0, 0(sp)
| 0x08000046 addi s0, sp, 0x10
| ;-- ptr:
| ;-- reloc.ptr:
| ;-- .L0 :
| 0x08000048 lui a5, 0x8000 ; 0x8000000
| ; segment.ehdr; RELOC 0
| ;-- ptr:
| ;-- reloc.ptr.800004c:
| 0x0800004c ld a5, 0x80(a5) ; RELOC 0 ; arg6
| 0x08000050 lw a4, 0(a5) ; arg6
| ;-- ptr32:
| ;-- reloc.ptr32:
| 0x08000052 lui a5, 0x8000 ; 0x8000000
| ; segment.ehdr; RELOC 0
| ;-- ptr32:
| ;-- reloc.ptr32.8000056:
| 0x08000056 ld a5, 0x78(a5) ; RELOC 0 ; arg6
| 0x0800005a lw a5, 0(a5) ; arg6
| 0x0800005c addw a5, a5, a4 ; arg6
@ -665,13 +665,13 @@ EXPECT=<<EOF
| 0x08000038 sw s0, 8(sp)
| 0x0800003a mv s0, a0
| 0x0800003c li a1, 0x2a
| ;-- __mulsi3:
| ;-- reloc.__mulsi3:
| 0x08000040 auipc ra, 0 ; RELOC 0
| 0x08000044 jalr 0x1d0(ra)
| ;-- .LBB0_2:
| ;-- reloc..LBB0_2:
| ,=< 0x08000048 bnez s0, loc..LBB0_2 ; RELOC 0 .LBB0_2 @ 0x0800004e
| | 0x0800004a li a0, 1
| | ;-- .LBB0_3:
| | ;-- reloc..LBB0_3:
| ,==< 0x0800004c j loc..LBB0_3 ; RELOC 0 .LBB0_3 @ 0x08000050
| || ;-- .LBB0_2:
| |`-> 0x0800004e addi a0, a0, 0xf ; RELOC TARGET 0 .LBB0_2 @ 0x0800004e
@ -720,13 +720,13 @@ EXPECT=<<EOF
| 0x08000044 sd s0, 0(sp)
| 0x08000046 mv s0, a0
| 0x08000048 li a1, 0x2a
| ;-- __muldi3:
| ;-- reloc.__muldi3:
| 0x0800004c auipc ra, 0 ; RELOC 0
| 0x08000050 jalr 0x24c(ra)
| ;-- .LBB0_2:
| ;-- reloc..LBB0_2:
| ,=< 0x08000054 bnez s0, loc..LBB0_2 ; RELOC 0 .LBB0_2 @ 0x0800005a
| | 0x08000056 li a0, 1
| | ;-- .LBB0_3:
| | ;-- reloc..LBB0_3:
| ,==< 0x08000058 j loc..LBB0_3 ; RELOC 0 .LBB0_3 @ 0x0800005c
| || ;-- .LBB0_2:
| |`-> 0x0800005a addiw a0, a0, 0xf ; RELOC TARGET 0 .LBB0_2 @ 0x0800005a ; arg1
@ -767,7 +767,7 @@ ir
EOF
EXPECT=<<EOF
;-- section..text:
;-- .LBB0_2:
;-- reloc..LBB0_2:
;-- test_forward_max:
/ loc._x.0();
| ,=< 0x08000034 beqz a0, loc..LBB0_2 ; RELOC 0 .LBB0_2 @ 0x08000132 ; [02] -r-x section size 1048 named .text
@ -853,7 +853,7 @@ ir
EOF
EXPECT=<<EOF
;-- section..text:
;-- .LBB0_2:
;-- reloc..LBB0_2:
;-- test_forward_max:
/ loc._x.0();
| ,=< 0x08000040 beqz a0, loc..LBB0_2 ; RELOC 0 .LBB0_2 @ 0x0800013e ; [02] -r-x section size 1048 named .text