[PATCH v2] bfd: fill in PE load config directory entry.
Jan Beulich
jbeulich@suse.com
Tue Mar 11 08:19:32 GMT 2025
On 11.03.2025 09:11, LIU Hao wrote:
> 在 2025-3-11 15:53, Jan Beulich 写道:
>> On 10.03.2025 19:25, Jeremy Drake wrote:
>>> @@ -4573,6 +4575,48 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo)
>>> #endif
>>> }
>>>
>>> + h1 = coff_link_hash_lookup (coff_hash_table (info),
>>> + (bfd_get_symbol_leading_char (abfd) != 0
>>> + ? "__load_config_used" : "_load_config_used"),
>>> + false, false, true);
>>
>> I understand the same is used when looking up _tls_used, yet it feels wrong
>> to assume that bfd_get_symbol_leading_char() can only ever return nil or '_'.
>> Nevertheless, because of the pre-existing similar code, I'm not going to
>> insist that this be corrected right here.
>
> The underscore thing is for x86-32, where external variable names are prefixed to make symbols. Symbols
> of `__fastcall` and `__vectorcall` functions are not prefixed with underscores, which doesn't apply to
> variables.
>
> On x86-64, ARM32 and ARM64, symbols are unprefixed.
I understand what this is for, but BFD specifically has an abstraction allowing
for prefixes other than '_', and this is being undermined by the _tls_used check
as well as this new one (and iirc also elsewhere). It would be nice to not
further spread such badness.
Jan
More information about the Binutils
mailing list