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

LIU Hao lh_mouse@126.com
Wed Mar 12 09:05:42 GMT 2025


在 2025-3-12 16:55, Jan Beulich 写道:
> On 11.03.2025 20:28, Jeremy Drake wrote:
>> I'm sorry, I was having a hard time understanding what you were
>> suggesting.  I *think* a light bulb just went on, that you are suggesting
>> issuing an error if h1 is NULL (the outer if).  This is not what I
>> intended: it is not an error if there is no symbol _load_config_used, it
>> should just not fill in the load config directory.  However, if the symbol
>> does exist, it should be of the correct type and have sufficient data
>> available at it to read the size.  Does this make sense, or am I
>> misunderstanding either the code or your feedback?
> 
> Hmm, yes, makes sense. But then why does the diagnostic say "is missing"?
> 
> Jan

I suspect that message was copied from `_tls_used`.

There are two issues in that message: First is that it should have said `_tls_used` which is what should 
be defined in source code. Second is that it looks like the error is triggered when the symbol is defined 
in an unexpected way, either it's a common (tentative?) definition or it has no output section. So it 
should be

    (_("%pB: unable to fill in DataDictionary[9] because _tls_used is not defined correctly"),

and likewise for `_load_config_used`.

There's another minor issue I think, which is these symbols cannot be weak.



-- 
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/20250312/b1f7754d/attachment.sig>


More information about the Binutils mailing list