[PATCH] D38260: [llvm-objcopy] Add support for removing sections

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 11:21:51 PDT 2017


jakehehrlich added a comment.

In https://reviews.llvm.org/D38260#884157, @jhenderson wrote:

> I think we could use one more test, if it is possible to construct: a section between two segments that is then removed, allowing the second segment to move in the file (but not in memory):
>
>   | Section 1 | Section 2 | Section 3 |
>   | Segment 1 |-----------| Segment 2 |
>
>
> Don't worry about it, if it's not possible to sensibly, as I think this an edge case that is unlikely to be seen in most situations.


A test like this is possible but I'm not sure it will test the desired behavior.

If an input file starts out like this

  | Section 1 | Section 2 | Section 3 |
  | Segment 1 |-----------| Segment 2 |

Then it will end up like this after copy (note that Section 2 is not removed) because of the new layout algortihm

  | Section 1 | Section 3 | Section 2 | 
  | Segment 1 | Segment 2 | ---------- |

I can add the test but it's worth pointing out that the reason the segments get placed together has nothing to do with Section 2 being removed or not removed.


Repository:
  rL LLVM

https://reviews.llvm.org/D38260





More information about the llvm-commits mailing list