Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

llvm-objdump --adjust-vma gives different result than GNU objdump #75444

Copy link
Copy link
Closed
@pwprzybyla

Description

@pwprzybyla
Issue body actions

There is a discrepancy between --adjust-vma of llvm-objdump and GNU objdump.
I use adjust-vma.test from llvm and generate the object file input.o.
Then I run both llvm-objdump --adjust-vma=0x123000 --all-headers -D -z input.o and objdump --adjust-vma=0x123000 --all-headers -D -z input.o .
From this thest I would expect to have same section adresses adjusted.
However there is difference between both:
GNU objdump

0000000000000000 <debug_str_sym>:
0: 00 00 add %al,(%rax)
1: R_X86_64_32 .text
2: 00 00 add %al,(%rax)

llvm-objdump
0000000000000000 <debug_str_sym>:
0: 00 00 addb %al, (%rax)
0000000000123001: R_X86_64_32 .text
2: 00 00 addb %al, (%rax)

To my understanding section debug_str_sym should not be adjusted as it is not allocatable section and it is debug one.
More to say in source code of llvm-objdump I can find following comment:

// Used for --adjust-vma to check if address should be adjusted by the
// specified value for a given section.
// For ELF we do not adjust non-allocatable sections like debug ones,
// because they are not loadable.
// TODO: implement for other file formats.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.