This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump] Dump inline relocations if the relocated section is specified with --section
ClosedPublic

Authored by MaskRay on May 22 2019, 6:49 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

MaskRay created this revision.May 22 2019, 6:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2019, 6:49 AM

This looks good (with my comment addressed :) But please wait unil anyone else also take a look.

tools/llvm-objdump/llvm-objdump.cpp
932 ↗(On Diff #200728)

This part contains unneseccary variable renamings and also a comment removal.
I would keep the old style.

jhenderson added inline comments.May 22 2019, 7:51 AM
test/tools/llvm-objdump/X86/section-filter-relocs.test
15–22 ↗(On Diff #200728)

With the behaviour change, I'm not sure you need all of this, because it's covered by the case on line 11. The purpose of this was mostly to show that -j limited which relocations were printed to the specified relocation sections. What do you think?

tools/llvm-objdump/llvm-objdump.cpp
932 ↗(On Diff #200728)

I'm actually okay with the RelSec -> Relocated name as it is easier to follow, and don't mind it changing.

MaskRay marked an inline comment as done.May 22 2019, 7:52 AM
MaskRay added inline comments.
tools/llvm-objdump/llvm-objdump.cpp
932 ↗(On Diff #200728)

My first impression of RelSec is something similar to .rel.sec, so I thought it relocated Section which obviously is not the case.. So I still prefer Relocated.

The comment is redundant.

Regarding Sec, I'm inclined to use Sec in case someone asks me to rename Relocated to RelocatedSec. RelocatedSection would be too verbose.

grimar added inline comments.May 22 2019, 7:55 AM
tools/llvm-objdump/llvm-objdump.cpp
932 ↗(On Diff #200728)

Ok, at least I would restore the comment. It was an innocent victim in this attack I think.

MaskRay updated this revision to Diff 200744.May 22 2019, 7:55 AM
MaskRay retitled this revision from [objdump] Dump inline relocations if the relocated section is specified with --section to [llvm-objdump] Dump inline relocations if the relocated section is specified with --section.

Address review comments

MaskRay updated this revision to Diff 200746.May 22 2019, 7:58 AM
MaskRay marked an inline comment as done.

Restore // Sort relocations by address.

Harbormaster completed remote builds in B32315: Diff 200746.
grimar accepted this revision.May 22 2019, 7:59 AM

LGTM

This revision is now accepted and ready to land.May 22 2019, 7:59 AM
MaskRay marked 2 inline comments as done.May 22 2019, 8:01 AM
MaskRay added inline comments.
tools/llvm-objdump/llvm-objdump.cpp
932 ↗(On Diff #200728)

OK, restores, I probably wouldn't attach that if I ran git blame first... BTW, I think llvm::stable_sort is probably better.

Because gABI says: "If multiple consecutive relocation records are applied to the same relocation location (r_offset), they are composed instead of being applied independently, as described above."

Though I can't find a case to make this break.

This revision was automatically updated to reflect the committed changes.
MaskRay marked an inline comment as done.