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)
Thu, Sep 26, 11:35 PM
Unknown Object (File)
Tue, Sep 17, 1:26 PM
Unknown Object (File)
Sat, Sep 14, 12:05 AM
Unknown Object (File)
Sep 2 2024, 2:10 PM
Unknown Object (File)
Aug 30 2024, 11:27 PM
Unknown Object (File)
Aug 29 2024, 8:14 PM
Unknown Object (File)
Aug 17 2024, 6:28 AM
Unknown Object (File)
Aug 2 2024, 4:28 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.