Fwd: SHF_LINK_ORDER's original semantics make upgrade difficult

James Henderson jh7370.2008@my.bristol.ac.uk
Thu Jul 16 07:32:32 GMT 2020


Cross-posting as my original attempt only went to the gabi list.

---------- Forwarded message ---------
From: James Henderson <jh7370@my.bristol.ac.uk>
Date: Thu, 16 Jul 2020 at 08:27
Subject: Re: SHF_LINK_ORDER's original semantics make upgrade difficult
To: Generic System V Application Binary Interface <
generic-abi@googlegroups.com>


I've run into this same problem whilst doing some prototyping work on
fragmenting DWARF sections into smaller pieces. These pieces are a mixture
of common pieces and function/variable-related pieces, with the latter
being associated with the corresponding text/data sections via
SHF_LINK_ORDER. However, in some cases, the section is laid out such that
there are multiple common pieces intermixed with the
function/variable-specific pieces (e.g. it might look like "common,
function, function, common, function, variable, common"). I actually don't
want this section to be ordered at all, since the original ordering should
be preserved.I've been using a hacked LLD for this, which removes the
ordering for SHF_LINK_ORDER completely, so that the sections remain in the
"natural" order, whilst the associated-with semantics for --gc-sections are
still preserved.

Whilst doing this, I couldn't help but feel that the associated-with and
ordering semantics are somewhat orthoganol. Clearly if a section is
ordered, it needs the associated-with semantics, but it seems like section
association is a different thing. There are multiple sections now where the
ordering is irrelevant, but which still wants association in some way.
Examples include LLVM's stack sizes section and debug data.The original
SHF_LINK_ORDER extension discussion actually started out with discussing a
SHF_ASSOCIATED flag. Maybe we should revisit that idea in some form? Thus,
SHF_ASSOCIATED implies the section should be discarded when it's linked
section is discarded, and SHF_LINK_ORDER requires ordering. I think both
for backwards-compatibility's sake and to avoid redundancy, we could say
SHF_LINK_ORDER implies SHF_ASSOCIATED.

-- 
You received this message because you are subscribed to the Google Groups
"Generic System V Application Binary Interface" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to generic-abi+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/generic-abi/14c7f411-c727-4f92-a5b5-ca3adc543c22n%40googlegroups.com
<https://groups.google.com/d/msgid/generic-abi/14c7f411-c727-4f92-a5b5-ca3adc543c22n%40googlegroups.com?utm_medium=email&utm_source=footer>
.


More information about the Binutils mailing list