[PATCH 3/4] bfd: avoid elf-sframe.c for SFrame-unaware targets
Jan Beulich
jbeulich@suse.com
Fri Dec 19 07:39:10 GMT 2025
On 18.12.2025 19:39, Indu Bhagat wrote:
> On 12/15/25 2:55 AM, Jan Beulich wrote:
>> It is wasteful to build this file when it's not actually used. Limit it
>> to targets actually using SFrame and introduce a compiler define
>> (paralleling OBJ_MAYBE_ELF, as having similar purpose) to guard internal
>> function decls.
>>
>
> Somewhat unrelated to the patch, but:
> Curious, why do we have a "_MAYBE_" in these macros? I guess _MAYBE_ in
> OBJ_MAYBE_ELF_SFRAME carries from the OBJ_MAYBE_ELF...
Yes. In patch 1 I'm making the connection to gas'es identically named
manifest constant.
> But what does MAYBE in the OBJ_MAYBE_ELF signify ? (In gas we have a
> OBJ_ELF..)
We have OBJ_MAYBE_ELF there, too, just that the number of uses has gone
down. When some ELF target is configured in, we don't know whether that
is _the_ target we're currently working with. Hence while in gas, when
emulations aren't in use, we can be sure it's ELF if ELF is the main
target, in libbfd we could use OBJ_ELF only when all enabled targets
are ELF. Since (afacis) there would be, for now at least, no meaningful
gain from having both OBJ_ELF and OBJ_MAYBE_ELF, I decided to go with
just the latter (for always describing the situation correctly).
Jan
More information about the Binutils
mailing list