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)
Apr 20 2024, 3:58 AM
Unknown Object (File)
Apr 20 2024, 3:55 AM
Unknown Object (File)
Mar 8 2024, 2:03 AM
Unknown Object (File)
Mar 8 2024, 12:18 AM
Unknown Object (File)
Feb 1 2024, 12:20 PM
Unknown Object (File)
Jan 7 2024, 8:09 PM
Unknown Object (File)
Dec 27 2023, 5:38 PM
Unknown Object (File)
Dec 27 2023, 5:10 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.