On 10/28/25 3:20 PM, Indu Bhagat wrote:
> On 2025-10-26 1:49 p.m., Ali Bahrami wrote:
>> I've never found SHF_OS_NONCONFORMING to be particularly
>> useful. I would rather not grow the collection of "what to do
>> when you don't know what you're doing" flags. It seems like
>> needless complexity, particularly as their use in any given
>> situation will continue long after its no longer needed.
>>
>> I appreciate the concern for naive linkers that don't know
>> SFrame, and for not wanting them to produce garbage results,
>> but I think that is a temporary problem, and not worth
>> catering to. Either SFrame will be a success and in demand,
>> and link-editors will jump to provide the support, or it won't,
>> in which case it really doesn't matter what naive linkers do
>> with it. Either way, I'd rather not burden ELF with it.
>>
>
> The flag is useful for any section requiring these semantics (SFrame
> happens to be one of them).
I don't think there are many cases where those semantics
are really required. I've never seen SHF_OS_NONCONFORMING
used for anything. That's not a challenge to go find some
use to prove me wrong, but just an observation based on my
experience. ELF is decades old, the problem of introducing
new section types is not new, and the simplest answer is
almost always to manage the rollout, and get past it.
> Checking at gcc configure time does not eliminate the problem. Users/
> packages are free to pick a linker of their choice at build time.
Very few users do that. Mostly, they use the link-editor through the
compiler wrapper, and accept the link-editor that the compiler chooses.
Some sophisticated users may want to go ala carte, and as you say,
they're free to pick a linker of their choice that's different than
what the compiler defaults to.
- Since you're working on gcc, and communicating with
a major contributor to llvm, it seems that you'll have the
most obvious 2 link-editors covered in short order. That
really does cover 99.xxx% of the cases that matter.
- A user sophisticated enough to pick a link-editor other than
the obvious 2 (GNU and LLVM) is sophisticated enough to
know what they're doing, and not produce these sections
if their link-editor can't handle it. These folks can handle
a few bad SFrame links, until they decide to fix their link-editor
to handle it, or drop it. And, they pay attention to new
developments in binutils and llvm --- they'll see it coming.
Finally, what big important, can't fail for a moment,
packages are built in this mode?
- Adding new features to handle the case of not understanding
new features has a meta problem: Today, no link-editors understand
SHF_OS_NONCONFORMING_DISCARD. Even if we did agree to add it to
the gABI, it will be years before all linkers, not just GNU
and llvm, can be assumed to implement them. In the meantime,
you still have to confront the problem of what to do when
they don't.
I just don't see the need for permanent ELF features to solve
a temporary problem, however annoying it might be in the moment.
Success comes from making SFrame work well when its supported,
and not from investing in what happens when it isn't.
- Ali