[PATCH] [lld] Define DefinedAtom::sectionSize.

Rui Ueyama ruiu at google.com
Mon Mar 2 14:25:32 PST 2015


On Sat, Feb 28, 2015 at 8:52 AM, Shankar Easwaran <
shankar.kalpathi.easwaran at gmail.com> wrote:

> in my opinion this is a shared attribute for all atoms that belong to a
> section. Can we store this information for the atom in the context? The
> other way is to add a Reference to store the size. If the idea is to add
> all format specific attributes in the Atom I am fine but we need to discuss
> on llvmdev before adding those features.
>

It's not feasible to make this an attribute of a section because as you
know we don't have a class representing a section. We basically copy
section properties to atoms in that section. Examples are permission (rwx
permissions), section name and merge. They are in all platforms properties
of sections, not of symbols, but we store them to atoms. So this is not new
at all.

As I wrote before, using references as a "generic key-value store" is a bad
idea. That way is basically equivalent to using a string-key associative
list as a replacement for C++ member variables. Sure we would be able to
store anything to that without defining new members. But that's apparently
what we don't want. It's too generic and unstructured. (If that's a good
idea, we should probably remove all member variables from Atom and make the
atom just a map. All members currently defined for Atom, such as ordinal or
size field, would then be a value in the map. That's obviously wrong
design.)


> Anyways this patch is not complete as it's missing YAML Support and native
> file format support.
>

Will add.


>
>
> http://reviews.llvm.org/D7966
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150302/def7aed6/attachment.html>


More information about the llvm-commits mailing list