[PATCH] D33964: [LLVM][llvm-objcopy] Added basic plumbing to get things started

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 11:10:01 PDT 2017


jakehehrlich marked 4 inline comments as done.
jakehehrlich added a comment.

In https://reviews.llvm.org/D33964#803460, @jhenderson wrote:

> Could you construct a test case that confirms the behaviour of nested segments, please? Something with a memory image like:
>
>   | Segment 1                                                        |
>   | Segment 2                               |
>   | Progbits Section | gap | NOBITS section | gap | Progbits section |  
>


I can confirm this just won't work right. As is the first Progbits section will wind up in two Segments and everything will get all messed up. For this diff I'm fine with that not being supported.  I'm also not sure what the intended behavior is in this case.



================
Comment at: test/tools/llvm-objcopy/hello-world.s:2
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
+# RUN: ld.lld %t.o -o %t
+# RUN: llvm-objcopy %t %t2
----------------
jhenderson wrote:
> I don't think this will work for many people, as LLD is not part of LLVM's main source code body, so people will be unable to run this test. That being said, I'm not sure how to work around this. Can yaml2obj help us here? (I'm not particularly familiar with that tool yet).
Oh man, that didn't even occur to me. As far as I am aware there is no way to produce program headers using yaml2obj. It never produces any program headers by default either. I think you're right and this should be fixed. I have no clue how to fix it other than adding support for program headers to yaml2obj. That's not something I've looked into however.

Perhaps there is a way to require lld for this test? That way it's just unsupported for most people?


Repository:
  rL LLVM

https://reviews.llvm.org/D33964





More information about the llvm-commits mailing list