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
Unknown Object (File)
Sat, Nov 23, 12:59 AM
Unknown Object (File)
Sun, Nov 17, 9:52 AM
Unknown Object (File)
Sat, Nov 16, 8:15 AM
Unknown Object (File)
Tue, Nov 5, 1:44 AM
Unknown Object (File)
Mon, Nov 4, 10:19 PM
Unknown Object (File)
Oct 30 2024, 10:29 AM
Unknown Object (File)
Oct 18 2024, 8:57 AM
Unknown Object (File)
Oct 16 2024, 2:40 PM

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.