Page MenuHomeFreeBSD

elfcopy: Select mode by the end of the program name
ClosedPublic

Authored by emaste on Jan 25 2015, 12:39 AM.
Tags
None
Referenced Files
F132984045: D1663.id.diff
Tue, Oct 21, 8:01 PM
F132982945: D1663.id21625.diff
Tue, Oct 21, 7:48 PM
F132981742: D1663.id3417.diff
Tue, Oct 21, 7:29 PM
F132979943: D1663.id3416.diff
Tue, Oct 21, 7:01 PM
F132978848: D1663.id3418.diff
Tue, Oct 21, 6:45 PM
F132931257: D1663.diff
Tue, Oct 21, 6:53 AM
Unknown Object (File)
Mon, Oct 20, 10:25 AM
Unknown Object (File)
Sun, Oct 12, 5:07 AM

Details

Summary

We select the mode of operation (elfcopy, mcs, or strip) based on the program name. Match the end of the name to allow prefixes - for example, bsdstrip or aarch64-freebsd-strip.

This improves use of these tools as drop-in replacements for GNU objcopy and strip, which are built with a limited set of supported targets and often installed with a target prefix for cross tools.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to elfcopy: Consider program name to start after last -.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added a subscriber: Unknown Object (MLST).
dim added a reviewer: dim.
dim added a subscriber: dim.

LGTM.

This revision is now accepted and ready to land.Jan 25 2015, 12:51 AM
emaste edited edge metadata.

Just compare the end of the program name with strip/mcs rather than looking for a dash. This is the way it's done in FreeBSD ar/ranlib already, and allows names like bsdstrip. Also add a test case.

This revision now requires review to proceed.Jan 25 2015, 1:56 AM
emaste retitled this revision from elfcopy: Consider program name to start after last - to elfcopy: Select mode by the end of the program name.
emaste updated this object.
emaste edited edge metadata.

Output a warning if the program name (argv[0]) does not match any of the expected ones.

dim edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Oct 22 2016, 8:09 PM
This revision was automatically updated to reflect the committed changes.