objcopy: A potentially new option --ignore-symbol(s)
Ilya Kuklin
ikuklin@accesssoftek.com
Tue Feb 27 18:56:47 GMT 2024
>> There is an option in the making for llvm-objcopy called --ignore-symbol(s).
>> We would like to have some feedback about the name of the option
>> and its functionality.
>>
>> The functionality of this option is to ignore the specified symbols when
>> executing other options that can change the symbol's name, binding or
>> visibility, so that their parameters remain unchanged.
>
> I think e.g. "skip" would be more appropriate than "ignore".
Thank you for the feedback! I will rename the options to --skip-symbol(s),
it does sound more fitting indeed.
>> For example, when executing an option --localize-hidden, specifying an
>> existing hidden symbol with --ignore-symbol will keep its binding from
>> being changed.
>
> Question is how useful a single negative option is when perhaps you want
> to do multiple adjustments at the same time, with different sets needing
> exclusion. Imo separate negative options (e.g. --no-localize-hidden)
> would be more suitable in the long run.
>
> Jan
It was made as an analogy to the existing --keep-symbol(s) option, which is
a single options that works for all other options that can strip symbols.
The idea was to also have a single option that can work with options that
change symbols' name, binding and visibility in order to keep it simple.
There are a lot of options that do that, so adding a negative option for
every one of them seems like somewhat overcomplicating it. If there is a
need to have different negative patterns for different options, then I feel
like it's a better idea to just run the tool multiple times.
>> Purpose:
>> This option is needed mostly to support cases where there is a need to
>> change parameters of a vast number of symbols with exception of a few
>> specific symbols. Writing a negative pattern is much simpler than many
>> positive patterns that avoid a certain case. Plus, since there is an option
>> --keep-symbol that does exactly this but for removing symbols, there
>> should also be one that keeps symbols' parameters from being changed.
>>
>> If an option with the same functionality is going to be introduced at some
>> point to binutils objcopy, please consider naming it the same way or
>> suggest an alternative.
>>
>> Feel free to join the discussion:
>> https://github.com/llvm/llvm-project/pull/80873
More information about the Binutils
mailing list