Bug 245024 - elftoolchain objcopy is missing --add-symbol
Summary: elftoolchain objcopy is missing --add-symbol
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-toolchain (Nobody)
URL:
Keywords: feature, needs-patch
Depends on:
Blocks:
 
Reported: 2020-03-24 02:18 UTC by Mark Johnston
Modified: 2024-10-04 12:40 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Johnston freebsd_committer freebsd_triage 2020-03-24 02:18:39 UTC
The objcopy from GNU binutils implements --add-symbol:

==
--add-symbol name=[section:]value[,flags]

    Add a new symbol named name while copying the file. This option may be specified multiple times. If the section is given, the symbol will be associated with and relative to that section, otherwise it will be an ABS symbol. Specifying an undefined section will result in a fatal error. There is no check for the value, it will be taken as specified. Symbol flags can be specified and not all flags will be meaningful for all object file formats. By default, the symbol will be global. The special flag ’before=othersym’ will insert the new symbol in front of the specified othersym, otherwise the symbol(s) will be added at the end of the symbol table in the order they appear.
==

elftoolchain objcopy does not.  I noticed because it would have been useful for a project I'm working on; I haven't seen a case where the lack of compatibility is a problem.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2022-12-14 14:08:43 UTC
llvm-objcopy:

  --add-symbol=name=[section:]value[,flags]
                          Add new symbol <name> to .symtab. Accepted flags: global, local, weak, default, hidden, protected, file, section, object, function, indirect-function. Accepted but ignored for compatibility: debug, constructor, warning, indirect, synthetic, unique-object, before.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2024-10-04 12:40:47 UTC
^Triage: clear stale flags.