[PATCH v2] bfd: fill in PE load config directory entry.
Jan Beulich
jbeulich@suse.com
Thu Mar 13 06:59:31 GMT 2025
On 12.03.2025 21:30, Jeremy Drake wrote:
> On Wed, 12 Mar 2025, LIU Hao wrote:
>> 在 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"?
>>
>> I suspect that message was copied from `_tls_used`.
>
> Yes, exactly. I just copied the _tls_used block and adjusted to
> _load_config_used and the load config directory. Actual
> new code is getting the size out of the section, instead of being a
> hardcoded size based on 32/64 bit.
>
>>
>> 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.
>
> If there's agreement on a different message I can update and send a new
> version of the patch.
The wording suggested above reads fine to me, fwiw.
Jan
More information about the Binutils
mailing list