Skip to content

Commit 1def87b

Browse files
image base for a dynamic ELF is always zero
1 parent 9052507 commit 1def87b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rdi_from_dwarf/rdi_from_dwarf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2604,7 +2604,7 @@ d2r_convert(Arena *arena, D2R_ConvertParams *params)
26042604
case ExecutableImageKind_Elf64: {
26052605
ELF_Bin bin = elf_bin_from_data(scratch.arena, params->dbg_data);
26062606
arch = arch_from_elf_machine(bin.hdr.e_machine);
2607-
image_base = elf_base_addr_from_bin(&bin);
2607+
image_base = bin.hdr.e_type == ELF_Type_Dyn ? 0 : elf_base_addr_from_bin(&bin);
26082608
binary_sections = e2r_rdi_binary_sections_from_elf_section_table(arena, bin.shdrs);
26092609
input = dw_input_from_elf_bin(scratch.arena, params->dbg_data, &bin);
26102610
path_style = PathStyle_UnixAbsolute;

0 commit comments

Comments
 (0)