In gcc/unwind-dw2-fde.h

/* The first few fields of a CIE.  The CIE_id field is 0 for a CIE,
   to distinguish it from a valid FDE.  FDEs are aligned to an addressing
   unit boundary, but the fields within are unaligned.  */
struct dwarf_cie
{
  uword length;
  sword CIE_id;
  ubyte version;
  unsigned char augmentation[];
} __attribute__ ((packed, aligned (__alignof__ (void *))));

/* The first few fields of an FDE.  */
struct dwarf_fde
{
  uword length;
  sword CIE_delta;
  unsigned char pc_begin[];
} __attribute__ ((packed, aligned (__alignof__ (void *))));

It indicates that CIE/FDE should be aligned at the pointer size. But crtstuff.c
has:

STATIC EH_FRAME_SECTION_CONST char __EH_FRAME_BEGIN__[]
     __attribute__((section(EH_FRAME_SECTION_NAME), aligned(4)))
     = { };

STATIC EH_FRAME_SECTION_CONST int32 __FRAME_END__[]
     __attribute__ ((unused, section(EH_FRAME_SECTION_NAME),
                     aligned(sizeof(int32))))
     = { 0 };

This leads to the corrupted .eh_frame section on x86-64:

http://sources.redhat.com/bugzilla/show_bug.cgi?id=2655


-- 
           Summary: The .eh_frame section in crtend.o has wrong aligment
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl at lucon dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27576

Reply via email to