Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion crates/examples/src/objdump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,13 @@ fn dump_parsed_object<W: Write, E: Write>(w: &mut W, e: &mut E, file: &object::F
writeln!(w)?;
writeln!(w, "Symbol map")?;
for symbol in file.symbol_map().symbols() {
writeln!(w, "0x{:x} \"{}\"", symbol.address(), symbol.name())?;
writeln!(
w,
"0x{:x}-0x{:x} \"{}\"",
symbol.address(),
symbol.address() + symbol.size(),
symbol.name()
)?;
}

Ok(())
Expand Down
18 changes: 9 additions & 9 deletions crates/examples/testfiles/coff/import_msvc.lib.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Symbols
Dynamic symbols

Symbol map
0x0 "test_x64_NULL_THUNK_DATA"
0x0-0x8 "test_x64_NULL_THUNK_DATA"

test_x64.dll:
Format: Coff Little-endian 32-bit
Expand All @@ -74,7 +74,7 @@ Symbols
Dynamic symbols

Symbol map
0x0 "__NULL_IMPORT_DESCRIPTOR"
0x0-0x14 "__NULL_IMPORT_DESCRIPTOR"

test_x64.dll:
Format: Coff Little-endian 32-bit
Expand Down Expand Up @@ -108,7 +108,7 @@ Symbols
Dynamic symbols

Symbol map
0x0 "__IMPORT_DESCRIPTOR_test_x64"
0x0-0xe "__IMPORT_DESCRIPTOR_test_x64"

test_x86.dll:
Format: Short Import File
Expand Down Expand Up @@ -139,7 +139,7 @@ Symbols
Dynamic symbols

Symbol map
0x0 "test_x86_NULL_THUNK_DATA"
0x0-0x4 "test_x86_NULL_THUNK_DATA"

test_x86.dll:
Format: Coff Little-endian 32-bit
Expand All @@ -160,7 +160,7 @@ Symbols
Dynamic symbols

Symbol map
0x0 "__NULL_IMPORT_DESCRIPTOR"
0x0-0x14 "__NULL_IMPORT_DESCRIPTOR"

test_x86.dll:
Format: Coff Little-endian 32-bit
Expand Down Expand Up @@ -194,7 +194,7 @@ Symbols
Dynamic symbols

Symbol map
0x0 "__IMPORT_DESCRIPTOR_test_x86"
0x0-0xe "__IMPORT_DESCRIPTOR_test_x86"

test_arm64ec.dll:
Format: Short Import File
Expand Down Expand Up @@ -226,7 +226,7 @@ Symbols
Dynamic symbols

Symbol map
0x0 "test_arm64ec_NULL_THUNK_DATA"
0x0-0x8 "test_arm64ec_NULL_THUNK_DATA"

test_arm64ec.dll:
Format: Coff Little-endian 32-bit
Expand All @@ -247,7 +247,7 @@ Symbols
Dynamic symbols

Symbol map
0x0 "__NULL_IMPORT_DESCRIPTOR"
0x0-0x14 "__NULL_IMPORT_DESCRIPTOR"

test_arm64ec.dll:
Format: Coff Little-endian 32-bit
Expand Down Expand Up @@ -281,4 +281,4 @@ Symbols
Dynamic symbols

Symbol map
0x0 "__IMPORT_DESCRIPTOR_test_arm64ec"
0x0-0x12 "__IMPORT_DESCRIPTOR_test_arm64ec"
2 changes: 1 addition & 1 deletion crates/examples/testfiles/elf/base-aarch64.o.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ Dynamic symbols
Dynamic relocations

Symbol map
0x0 "main"
0x0-0x20 "main"
34 changes: 17 additions & 17 deletions crates/examples/testfiles/elf/base-aarch64.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,20 @@ Import { library: "", name: "_ITM_registerTMCloneTable" }
Import { library: "libc.so.6", name: "printf" }

Symbol map
0x598 "_init"
0x620 "_start"
0x658 "call_weak_fn"
0x670 "deregister_tm_clones"
0x6a0 "register_tm_clones"
0x6d8 "__do_global_dtors_aux"
0x720 "frame_dummy"
0x724 "main"
0x748 "__libc_csu_init"
0x7c8 "__libc_csu_fini"
0x7cc "_fini"
0x7e0 "_IO_stdin_used"
0x7f8 "__FRAME_END__"
0x10d80 "__frame_dummy_init_array_entry"
0x10d88 "__do_global_dtors_aux_fini_array_entry"
0x11008 "__dso_handle"
0x11010 "__TMC_END__"
0x598-0x5ac "_init"
0x620-0x658 "_start"
0x658-0x66c "call_weak_fn"
0x670-0x6a0 "deregister_tm_clones"
0x6a0-0x6d8 "register_tm_clones"
0x6d8-0x720 "__do_global_dtors_aux"
0x720-0x724 "frame_dummy"
0x724-0x744 "main"
0x748-0x7c8 "__libc_csu_init"
0x7c8-0x7cc "__libc_csu_fini"
0x7cc-0x7dc "_fini"
0x7e0-0x7e4 "_IO_stdin_used"
0x7f8-0x7fc "__FRAME_END__"
0x10d80-0x10d88 "__frame_dummy_init_array_entry"
0x10d88-0x10d90 "__do_global_dtors_aux_fini_array_entry"
0x11008-0x11010 "__dso_handle"
0x11010-0x11011 "completed.8500"
2 changes: 1 addition & 1 deletion crates/examples/testfiles/elf/base-crel.o.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Dynamic symbols
Dynamic relocations

Symbol map
0x0 "main"
0x0-0x25 "main"
42 changes: 21 additions & 21 deletions crates/examples/testfiles/elf/base-relr-i686.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,24 @@ Import { library: "", name: "_ITM_registerTMCloneTable" }
Export { name: "_IO_stdin_used", address: 2004 }

Symbol map
0x1cc "__abi_tag"
0x1000 "_init"
0x1060 "_start"
0x1090 "__x86.get_pc_thunk.bx"
0x10a0 "deregister_tm_clones"
0x10e0 "register_tm_clones"
0x1130 "__do_global_dtors_aux"
0x1180 "frame_dummy"
0x1189 "__x86.get_pc_thunk.dx"
0x118d "main"
0x11cd "__x86.get_pc_thunk.ax"
0x11d4 "_fini"
0x2000 "_fp_hw"
0x2004 "_IO_stdin_used"
0x2110 "__FRAME_END__"
0x3ec0 "__frame_dummy_init_array_entry"
0x3ec4 "__do_global_dtors_aux_fini_array_entry"
0x3ec8 "_DYNAMIC"
0x3fd8 "_GLOBAL_OFFSET_TABLE_"
0x4004 "__dso_handle"
0x4008 "__TMC_END__"
0x1cc-0x1ec "__abi_tag"
0x1000-0x1020 "_init"
0x1060-0x108c "_start"
0x1090-0x1094 "__x86.get_pc_thunk.bx"
0x10a0-0x10e0 "deregister_tm_clones"
0x10e0-0x1130 "register_tm_clones"
0x1130-0x1180 "__do_global_dtors_aux"
0x1180-0x1189 "frame_dummy"
0x1189-0x118d "__x86.get_pc_thunk.dx"
0x118d-0x11cd "main"
0x11cd-0x11d1 "__x86.get_pc_thunk.ax"
0x11d4-0x11e8 "_fini"
0x2000-0x2004 "_fp_hw"
0x2004-0x2008 "_IO_stdin_used"
0x2110-0x2114 "__FRAME_END__"
0x3ec0-0x3ec4 "__frame_dummy_init_array_entry"
0x3ec4-0x3ec8 "__do_global_dtors_aux_fini_array_entry"
0x3ec8-0x3fd8 "_DYNAMIC"
0x3fd8-0x4000 "_GLOBAL_OFFSET_TABLE_"
0x4004-0x4008 "__dso_handle"
0x4008-0x4009 "completed.0"
34 changes: 17 additions & 17 deletions crates/examples/testfiles/elf/base-relr-x86_64.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,20 @@ Import { library: "", name: "_ITM_registerTMCloneTable" }
Import { library: "libc.so.6", name: "__cxa_finalize" }

Symbol map
0x38c "__abi_tag"
0x1000 "_init"
0x1060 "_start"
0x1090 "deregister_tm_clones"
0x10c0 "register_tm_clones"
0x1100 "__do_global_dtors_aux"
0x1140 "frame_dummy"
0x1149 "main"
0x116c "_fini"
0x2000 "_IO_stdin_used"
0x20f0 "__FRAME_END__"
0x3d88 "__frame_dummy_init_array_entry"
0x3d90 "__do_global_dtors_aux_fini_array_entry"
0x3d98 "_DYNAMIC"
0x3fb8 "_GLOBAL_OFFSET_TABLE_"
0x4008 "__dso_handle"
0x4010 "__TMC_END__"
0x38c-0x3ac "__abi_tag"
0x1000-0x101b "_init"
0x1060-0x1086 "_start"
0x1090-0x10c0 "deregister_tm_clones"
0x10c0-0x1100 "register_tm_clones"
0x1100-0x1140 "__do_global_dtors_aux"
0x1140-0x1149 "frame_dummy"
0x1149-0x116c "main"
0x116c-0x1179 "_fini"
0x2000-0x2004 "_IO_stdin_used"
0x20f0-0x20f4 "__FRAME_END__"
0x3d88-0x3d90 "__frame_dummy_init_array_entry"
0x3d90-0x3d98 "__do_global_dtors_aux_fini_array_entry"
0x3d98-0x3fb8 "_DYNAMIC"
0x3fb8-0x4000 "_GLOBAL_OFFSET_TABLE_"
0x4008-0x4010 "__dso_handle"
0x4010-0x4011 "completed.0"
2 changes: 1 addition & 1 deletion crates/examples/testfiles/elf/base.o.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ Dynamic symbols
Dynamic relocations

Symbol map
0x0 "main"
0x0-0x1c "main"
36 changes: 18 additions & 18 deletions crates/examples/testfiles/elf/base.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,21 @@ Import { library: "", name: "_ITM_registerTMCloneTable" }
Import { library: "libc.so.6", name: "__cxa_finalize" }

Symbol map
0x520 "_init"
0x570 "_start"
0x5a0 "deregister_tm_clones"
0x5e0 "register_tm_clones"
0x630 "__do_global_dtors_aux"
0x670 "frame_dummy"
0x67a "main"
0x6a0 "__libc_csu_init"
0x710 "__libc_csu_fini"
0x714 "_fini"
0x720 "_IO_stdin_used"
0x874 "__FRAME_END__"
0x200da8 "__frame_dummy_init_array_entry"
0x200db0 "__do_global_dtors_aux_fini_array_entry"
0x200db8 "_DYNAMIC"
0x200fb8 "_GLOBAL_OFFSET_TABLE_"
0x201008 "__dso_handle"
0x201010 "__TMC_END__"
0x520-0x537 "_init"
0x570-0x59b "_start"
0x5a0-0x5e0 "deregister_tm_clones"
0x5e0-0x600 "register_tm_clones"
0x630-0x670 "__do_global_dtors_aux"
0x670-0x67a "frame_dummy"
0x67a-0x696 "main"
0x6a0-0x705 "__libc_csu_init"
0x710-0x712 "__libc_csu_fini"
0x714-0x71d "_fini"
0x720-0x724 "_IO_stdin_used"
0x874-0x878 "__FRAME_END__"
0x200da8-0x200db0 "__frame_dummy_init_array_entry"
0x200db0-0x200db8 "__do_global_dtors_aux_fini_array_entry"
0x200db8-0x200fb8 "_DYNAMIC"
0x200fb8-0x201000 "_GLOBAL_OFFSET_TABLE_"
0x201008-0x201010 "__dso_handle"
0x201010-0x201011 "completed.7698"
4 changes: 2 additions & 2 deletions crates/examples/testfiles/macho/base-aarch64-debug.o.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ Import { library: "", name: "_printf" }
Export { name: "_main", address: 0 }

Symbol map
0x0 "_main"
0x34 "l_.str"
0x0-0x34 "_main"
0x34-0x41 "l_.str"
4 changes: 2 additions & 2 deletions crates/examples/testfiles/macho/base-aarch64.o.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ Import { library: "", name: "_printf" }
Export { name: "_main", address: 0 }

Symbol map
0x0 "_main"
0x34 "l_.str"
0x0-0x34 "_main"
0x34-0x41 "l_.str"
4 changes: 2 additions & 2 deletions crates/examples/testfiles/macho/base-aarch64.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ Export { name: "__mh_execute_header", address: 100000000 }
Export { name: "_main", address: 100003f68 }

Symbol map
0x100000000 "__mh_execute_header"
0x100003f68 "_main"
0x100000000-0x100003f68 "__mh_execute_header"
0x100003f68-0x100003f9c "_main"
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ Import { library: "", name: "_printf" }
Export { name: "_main", address: 0 }

Symbol map
0x0 "_main"
0x0-0x25 "_main"
2 changes: 1 addition & 1 deletion crates/examples/testfiles/macho/base-x86_64.o.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Import { library: "", name: "_printf" }
Export { name: "_main", address: 0 }

Symbol map
0x0 "_main"
0x0-0x25 "_main"
6 changes: 3 additions & 3 deletions crates/examples/testfiles/macho/base-x86_64.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ Export { name: "__mh_execute_header", address: 100000000 }
Export { name: "_main", address: 100003f60 }

Symbol map
0x100000000 "__mh_execute_header"
0x100003f60 "_main"
0x100008008 "__dyld_private"
0x100000000-0x100003f60 "__mh_execute_header"
0x100003f60-0x100003f85 "_main"
0x100008008-0x100008010 "__dyld_private"
2 changes: 1 addition & 1 deletion crates/examples/testfiles/macho/reloc-aarch64.o.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ Import { library: "", name: "_g0" }
Import { library: "", name: "_g1" }

Symbol map
0x28 "_data"
0x28-0x48 "_data"
4 changes: 2 additions & 2 deletions crates/examples/testfiles/macho/reloc-arm.o.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ Import { library: "", name: "_g0" }
Export { name: "_g2", address: 14 }

Symbol map
0x0 "_g1"
0x14 "_g2"
0x0-0x14 "_g1"
0x14-0x28 "_g2"
4 changes: 2 additions & 2 deletions crates/examples/testfiles/macho/reloc-i386.o.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ Import { library: "", name: "_g0" }
Export { name: "_g2", address: 10 }

Symbol map
0x0 "_g1"
0x10 "_g2"
0x0-0x10 "_g1"
0x10-0x11 "_g2"
4 changes: 2 additions & 2 deletions crates/examples/testfiles/macho/reloc-x86_64.o.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ __data relocations
Dynamic symbols

Symbol map
0x0 "_g1"
0x5 "_g2"
0x0-0x5 "_g1"
0x5-0x53 "_g2"
4 changes: 2 additions & 2 deletions crates/examples/testfiles/pe/base-bigobj.o.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ Symbols
Dynamic symbols

Symbol map
0x0 "printf"
0x51 "main"
0x0-0x10 "printf"
0x51-0x80 "main"
2 changes: 1 addition & 1 deletion crates/examples/testfiles/pe/base-bigobj.obj.objdump
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ Symbols
Dynamic symbols

Symbol map
0x0 "_main"
0x0-0xa "_main"
Loading
Loading