<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Nick,<br>
<br>
I am trying to implement support for handling section groups in lld.<br>
<br>
There are two ways of figuring out section groups with ELF.<br>
<br>
a) Sections with SHF_GROUP property<br>
b) .gnu.linkonce sections (the signature identified by the name of
the section) -- This was the method to coalesce similiar constants.<br>
<br>
Section Groups(SHF_GROUP) is the preferred way on ELF but
.gnu.linkonce sections is also used.<br>
<br>
We would need to support both occurences in ELF files with lld.<br>
<br>
<u><b>Problem</b></u><br>
<br>
Currently the SymbolTable assumes that an atom is going to be
replaced by one another atom, but in the case of a section group, a
whole group can be coalesced depending on whether the group with the
same signature was previously seen.<br>
<br>
<u><b>Example</b></u><br>
<br>
For simplicity I am considering two section groups A and B (that
have the same signature). <br>
<br>
Say A contains atoms A1, A2, A3, and the section group B contains
atoms A1", A2", A3"<br>
<br>
To complicate things, groups A can contain fewer atoms than group
B(currently supported on ELF!) -- This happens in environments where
the user tried to compile object files and forgot to compile the
rest of the object files. <br>
<br>
<u><b>Problem</b></u><br>
Its easier to only set the _replaceAtoms[A] = B and the Resolver
could just remove B in this case.<br>
<br>
Inorder to remove all the atoms in Group B, B and all its
layout-after references need to be iterated. The problem is still
the _replacedAtoms map that needs to be set before all the atoms in
B can be coalesced.<br>
<br>
<u><b>Solution</b></u><br>
A way to accomplish this could be to <br>
<br>
A) Use the in-group reference along with the layout-after reference.
The in-group reference for atoms in the group B are going to contain
B as the root of the group.<br>
<br>
B) Another way is that we could have a Atom attribute
coalescedAway() which would be set for all atoms that we want to
remove. This would also need in-group references.<br>
<br>
I am ok with either of the methods (A) or (B) but inclined towards
(B).<br>
<br>
Thanks<br>
<br>
Shankar Easwaran<br>
<br>
<br>
-- Qualcomm Innovation Center, Inc. is a member of Code Aurora
Forum, hosted by the Linux Foundation
</body>
</html>