This is an archive of the discontinued LLVM Phabricator instance.

llvm-objdump: sort phdr strings and add PT_NOTE
AbandonedPublic

Authored by emaste on Dec 23 2016, 5:00 PM.

Details

Reviewers
davide

Diff Detail

Event Timeline

emaste updated this revision to Diff 82429.Dec 23 2016, 5:00 PM
emaste retitled this revision from to llvm-objdump: sort phdr strings and add PT_NOTE.
emaste updated this object.
emaste added a subscriber: llvm-commits.
davide added a subscriber: davide.Dec 24 2016, 3:55 AM

This can be probably separated in two commits, which sorts and the other one which adds PT_NOTE.
For 1), LGTM, and you can probably commit it as is. For 2), please add a test and I'll take another look.

For 2), please add a test and I'll take another look.

I couldn't find any existing examples of similar tests - we need a linked binary here so we have phdrs. Do you have any suggestions? We could make use of lld perhaps?

For 2), please add a test and I'll take another look.

I couldn't find any existing examples of similar tests - we need a linked binary here so we have phdrs. Do you have any suggestions? We could make use of lld perhaps?

I don't think it's reasonable to call lld in the test as it's a subproject and that would violate the property of llvm test suite being self-contained. When I had to deal with this in the past I checked in a binary or used yaml2obj to craft an object. If you go for 1) I recommend to add precise instructions on how you created the binary (i.e. source code + clang/lld invocation etc..)

davide requested changes to this revision.Dec 24 2016, 7:35 AM
davide added a reviewer: davide.
This revision now requires changes to proceed.Dec 24 2016, 7:35 AM

When I had to deal with this in the past I checked in a binary or used yaml2obj to craft an object.

OK. yaml2obj can't create phdr entries so I'll see about crafting a small binary that could be checked in.

PT_NOTE was implemented as r292170. You can probably rebase and sort the strings, still.

emaste abandoned this revision.Jan 20 2017, 12:29 PM

Sorting was committed in rL290494 and PT_LOAD in rL292170.