[lld] filename in the atom model.

+ Nick

Rui,

Does PECOFF writer need the filename in the writer as well, I am not sure if linker scripts are supported with PECOFF though.

If PECOFF also needs it, I think it makes sense to store the filename in the Atom as the native format needs to store that information.

The only option for the ELF writer to know this information is to use References if other flavors dont need the filename (only in DEBUG mode, clumsy but would work).

PS : Moving this discussion to llvmdev.

Shankar Easwaran

We don’t need a filename for the PE/COFF writer, but if it existed, it wouldn’t hurt us. We’ll leave the field nullptr.

I don’t think we need to vote here. Even if only one arch needs it, if it should naturally be added to Atom, it should be added to Atom.

Hi,

Since all the atoms in a file share the same filename/membername(for archives), we could have a field thats could be used as metadata. Formats may decide to store metadata information, if they decide to.

We should restrict the types of metadata information that can be added though (metadataKinds).

Shankar Easwaran

Hi,

Since all the atoms in a file share the same filename/membername(for
archives), we could have a field thats could be used as metadata. Formats
may decide to store metadata information, if they decide to.

We should restrict the types of metadata information that can be added
though (metadataKinds).

Yes and no. We cannot just say we should restrict. What we need is to think
carefully before adding a field of Atom. If there's a legitimate reason,
it's totally okay to add a new one. What's worse is to invent a complicated
workaround just to avoid adding a new field.