[PATCH] D58173: [llvm-objcopy] Add --set-start, --change-start, --adjust-start

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 19 01:38:08 PST 2019


jhenderson added a comment.

In D58173#1401364 <https://reviews.llvm.org/D58173#1401364>, @jakehehrlich wrote:

> 1. What's the use case for this?
> 2. What's the interaction for program headers?
>
>   For relocatable files I'd expect addresses to be ignored and for program headers I'd like to put more thought into this. In general, I'd like to take a stance that we not implement flags that we don't have a use case for.


Re. 2) This will have no interaction with program headers (though we might want to check that the address is within a loadable program header). All it does is change the e_entry field of the ELF header, i.e. the start address of the program. Personally, I don't have an issue with it changing that value in an ET_REL file (normally it would be 0), but we should follow what GNU objcopy does in that case. It doesn't hurt to have the value set in such a file; it's just meaningless.

I don't personally have a use case for this, but I could imagine a program with multiple possible start locations, and these switches allow switching between them. I'd like to here the concrete use case though.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58173/new/

https://reviews.llvm.org/D58173





More information about the llvm-commits mailing list