Page MenuHomePhabricator

[llvm-objcopy] Simplify --prefix-alloc-sections
ClosedPublic

Authored by MaskRay on Thu, Aug 29, 1:22 AM.

Details

Summary

Handle --prefix-alloc-sections after --rename-sections so that --prefix-alloc-sections code
does not have to check if renaming has been performed.

Diff Detail

Repository
rL LLVM

Event Timeline

MaskRay created this revision.Thu, Aug 29, 1:22 AM

I agree that this code is simpler, but I'm slightly hesitant you might have impaired performance of the loop, since we now have to loop over all sections twice when using both --prefix-alloc-sections and --rename-sections switches. Admittedly, I suspect this is a rare case (I still don't know of a reasonable use-case for --prefix-alloc-sections), so maybe it's not worth worrying about. @rupprecht, I think you had some performance issues with llvm-objcopy in the past. Do you have any insight into whether my concern is justified? If not, LGTM.

jhenderson accepted this revision.Tue, Sep 10, 1:51 AM

LGTM, if @rupprecht is happy (or he doesn't get back in a reasonable amount of time).

This revision is now accepted and ready to land.Tue, Sep 10, 1:51 AM
This revision was automatically updated to reflect the committed changes.