This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC} Supporting aligned commons in PE.


    Hello everyone,


  GCC PR37216[*] describes a problem with vector datatypes being misaligned
with current GCC and binutils.  The reason this happens is that there is no
support in the PE/COFF specification for specifying the alignment of COMMON
symbols.  Although there is a reasonable workaround using -fno-common, that's
no reason not to see if we can't make the toolchain DTRT.

  Before I start coding, I'd like to know if anyone cares much about the
mechanism.  In comment 50[**], Brian suggested adding a .gnu.note.aligncomm
section.  There are two other mechanisms that spring to mind:

1)  Invent a custom auxiliary symbol record format.  There isn't currently any
aux symbol format defined for ordinary IMAGE_SYM_CLASS_EXTERNAL aymbols, and
the spec says "Tools that read COFF symbol tables must ignore auxiliary symbol
records whose interpretation is unknown. This allows the symbol table format
to be extended to add new auxiliary records, without breaking existing tools",
so it should be permitted and silently ignored by the vendor tools.

2)  Add a new type of statement to the .drectve section, with a syntax such as
"-aligncomm:<symbolname>,<alignment>".  This might cause noisy warnings from
the vendors tools, but I think it's a cleaner interface than inventing our own
non-approved aux symbol format, so up til now it's my preferred option.

  Anyone who can see issues with (or advantages in) doing this one way or the
other, please let us know what you think!


    cheers,
      DaveK



[*]  - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216
[**] - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216#c50


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]