[PATCH] Fix missing definition for Linker alignment limit
Richard Guenther
richard.guenther@gmail.com
Mon May 12 08:55:00 GMT 2008
On Mon, May 12, 2008 at 2:32 AM, Andy H <hutchinsonandy@aim.com> wrote:
> This is fix for AVR target which does not have explicit definition for
> MAX_OFILE_ALIGNMENT.
>
> So it defaults to value of BIGGEST_ALIGNMENT = 8 bits (1 byte).
>
> So any alignment attempt will produce warning :
>
> debugstuff.c:4: warning: alignment of 'Foo' is greater than maximum
> object file alignment. Using 1
>
> Note alignment is forced to 1 (byte)
>
> Simple testcase:
>
> typedef int aligned_int __attribute__ ((aligned (2)));
> struct { char c;aligned_int a,b;} xa = {1,2};
>
> The attached patch corrects this by defining a more appropriate linker
> alignment limit.
>
> Tested on full testsuite. There were 32 less failures and no regressions
>
> # of expected passes 43485
> # of unexpected failures 564
> # of unexpected successes 3
> # of expected failures 92
> # of unresolved testcases 172
> # of untested testcases 67
> # of unsupported tests 1466
>
> xgcc version 4.4.0 20080511
>
>
> -------------------------------------------------------------------------------------
>
> 2008-05-11 Andy Hutchinson <hutchinsonandy@aim.com>
>
> * config/avr/avr.h (MAX_OFILE_ALIGNMENT_: Define.
>
>
> Can you approve for gcc head.
I would consider this also appropriate for the 4.3 branch.
Thanks,
Richard.
>
>
>
>
>
>
>
> Index: gcc/config/avr/avr.h
> ===================================================================
> --- gcc/config/avr/avr.h (revision 135174)
> +++ gcc/config/avr/avr.h (working copy)
> @@ -147,6 +147,9 @@
> /* No data type wants to be aligned rounder than this. */
> #define BIGGEST_ALIGNMENT 8
>
> +/* Maximum alignment permitted by linker */
> +#define MAX_OFILE_ALIGNMENT (32768 * 8)
> +
> #define TARGET_VTABLE_ENTRY_ALIGN 8
>
> #define STRICT_ALIGNMENT 0
>
>
More information about the Gcc-patches
mailing list