bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

not working alignment in as + ld


From: Sergey Grigoriev
Subject: not working alignment in as + ld
Date: Sat, 8 Jun 2002 22:17:52 +0200 (MESZ)

Using gcc's __attribute__((align(16))) functionality (nessesary for sse2
and partially sse) results in the compiler correctly generating
.align directives.
They are not ignored by the assembler and generated symbols are properly
aligned in single object-file. But the size of object file is not 16-byte
aligned. Linked by ld it will be no more aligned in resuling data
segments. 
As workaround (and probably as fix) I copied the part of coff-go32.c file
into pe-i386.c and pei-i386.c files in BFD-library to force gas to produce
16-bytes aligned data-segments like it is done for i386-GO32 platform.

bfd/pei-i386.c:
bfd/pe-i386.c:

#define COFF_LONG_FILENAMES

#define COFF_SECTION_ALIGNMENT_ENTRIES \
{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \
  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \
  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \
  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \
  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }

#include "coff-i386.c"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]