[PATCH v2] bfd: fill in PE load config directory entry.

LIU Hao lh_mouse@126.com
Tue Mar 11 10:57:38 GMT 2025


在 2025-3-11 16:19, Jan Beulich 写道:
> 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.

I think this can be cleaner if it's desired:

    ```
    char var_symbol[64];
    var_symbol[0] = bfd_get_symbol_leading_char (abfd);
    char* var_name = var_symbol + !!var_symbol[0];

    strcpy(var_name, "_tls_used");
    h1 = coff_link_hash_lookup (coff_hash_table (info), var_symbol, false, false, true);
    // ...

    strcpy(var_name, "_load_config_used");
    h1 = coff_link_hash_lookup (coff_hash_table (info), var_symbol, false, false, true);
    // ...
    ```





-- 
Best regards,
LIU Hao
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/binutils/attachments/20250311/611bc4ed/attachment.sig>


More information about the Binutils mailing list