public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* objcopy: A potentially new option --ignore-symbol(s)
@ 2024-02-22 17:51 Ilya Kuklin
  2024-02-23  8:16 ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Ilya Kuklin @ 2024-02-22 17:51 UTC (permalink / raw)
  To: binutils

Hello,

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.

For example, when executing an option --localize-hidden, specifying an 
existing hidden symbol with --ignore-symbol will keep its binding from 
being changed.

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

--
Thanks,
Ilya Kuklin

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: objcopy: A potentially new option --ignore-symbol(s)
@ 2024-02-27 18:56 Ilya Kuklin
  0 siblings, 0 replies; 3+ messages in thread
From: Ilya Kuklin @ 2024-02-27 18:56 UTC (permalink / raw)
  To: Jan Beulich; +Cc: binutils

>> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-27 18:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-22 17:51 objcopy: A potentially new option --ignore-symbol(s) Ilya Kuklin
2024-02-23  8:16 ` Jan Beulich
2024-02-27 18:56 Ilya Kuklin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).