This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


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

Re: __attribute__ ((packed))


Philippe De Muyter wrote:
> 
> The test below is not strong enough to decide __attribute__ ((packed)) is
> supported.  Perhaps the best way, if `packed' is really needed, would be
> to do an autoconf test.
> 
> Thu May  6 12:32:55 1999  Philippe De Muyter  <phdm@macqel.be>
> 
>         * include/elf/external.h (Elf_External_Versym) : __attribute__ ((
>         packed)) turned off.
> 
> --- ./include/elf/external.h    Thu May  6 12:34:15 1999
> +++ ./include/elf/external.h    Wed Apr 28 13:37:55 1999
> @@ -241,8 +241,10 @@
>  typedef struct {
>    unsigned char                vs_vers[2];
>  }
> +#if 0
>  #ifdef __GNUC__
>    __attribute__ ((packed))
> +#endif
>  #endif
>    Elf_External_Versym;
> 

This change will break some of the ELF code on the ARM.  There are places in the
code where sizeof(Elf_External_Versym) is used, and is expected to be 2.  On the
ARM without the packed attribute this struct will be 4 bytes in length.

Scott