From: Nick Clifton Date: Tue, 14 Jul 2009 15:47:13 +0000 (+0000) Subject: * config/tc-arm.h (MAX_MEM_ALIGNMENT_BYTES): Define. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=140033b39116ffc7d6ca946c43c19880e2e48a0c;p=binutils-gdb.git * config/tc-arm.h (MAX_MEM_ALIGNMENT_BYTES): Define. (MAX_MEM_FOR_RS_ALIGN_CODE): Define in terms of MAX_MEM_ALIGNMENT_BYTES. * config/tc-arm.c (arm_frag_align_code): Replace hard coded constant with MAX_MEM_FOR_RS_ALIGN_CODE. * gas/arm/align64.s: New test case. * gas/arm/align64.d: Expected disassembly. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index bf7dc296693..63a654d17b0 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2009-07-14 Daniel Gutson + + * config/tc-arm.h (MAX_MEM_ALIGNMENT_BYTES): Define. + (MAX_MEM_FOR_RS_ALIGN_CODE): Define in terms of + MAX_MEM_ALIGNMENT_BYTES. + * config/tc-arm.c (arm_frag_align_code): Replace hard coded + constant with MAX_MEM_FOR_RS_ALIGN_CODE. + 2009-07-14 Nick Clifton PR 10387 diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h index 47fce80d9f8..53ca895733a 100644 --- a/gas/config/tc-arm.h +++ b/gas/config/tc-arm.h @@ -193,7 +193,8 @@ void arm_copy_symbol_attributes (symbolS *, symbolS *); #define TC_CONS_FIX_NEW cons_fix_new_arm -#define MAX_MEM_FOR_RS_ALIGN_CODE 31 +#define MAX_MEM_ALIGNMENT_BYTES 6 +#define MAX_MEM_FOR_RS_ALIGN_CODE ((1 << MAX_MEM_ALIGNMENT_BYTES) - 1) /* For frags in code sections we need to record whether they contain ARM code or THUMB code. This is that if they have to be aligned, diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 94af320b188..caf8eabf46e 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-07-14 Daniel Gutson + + * gas/arm/align64.s: New test case. + * gas/arm/align64.d: Expected disassembly. + 2009-07-14 Daniel Gutson * gas/arm/thumb-w-bad.d: New test case. diff --git a/gas/testsuite/gas/arm/align64.d b/gas/testsuite/gas/arm/align64.d new file mode 100644 index 00000000000..cee7442d9fd --- /dev/null +++ b/gas/testsuite/gas/arm/align64.d @@ -0,0 +1,69 @@ +# name: 64 Bytes alignment test +# objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*arm.* + +Disassembly of section .text: +00000000 f04f 0001.*mov.w.*r0, #1 +00000004 46c0.*nop.* +00000006 46c0.*nop.* +00000008 46c0.*nop.* +0000000a 46c0.*nop.* +0000000c 46c0.*nop.* +0000000e 46c0.*nop.* +00000010 46c0.*nop.* +00000012 46c0.*nop.* +00000014 46c0.*nop.* +00000016 46c0.*nop.* +00000018 46c0.*nop.* +0000001a 46c0.*nop.* +0000001c 46c0.*nop.* +0000001e 46c0.*nop.* +00000020 46c0.*nop.* +00000022 46c0.*nop.* +00000024 46c0.*nop.* +00000026 46c0.*nop.* +00000028 46c0.*nop.* +0000002a 46c0.*nop.* +0000002c 46c0.*nop.* +0000002e 46c0.*nop.* +00000030 46c0.*nop.* +00000032 46c0.*nop.* +00000034 46c0.*nop.* +00000036 46c0.*nop.* +00000038 46c0.*nop.* +0000003a 46c0.*nop.* +0000003c 46c0.*nop.* +0000003e 46c0.*nop.* +00000040 f04f 0002.*mov.w.*r0, #2 +00000044 e3a00003.*mov.*r0, #3 +00000048 e1a00000.*nop.* +0000004c e1a00000.*nop.* +00000050 e1a00000.*nop.* +00000054 e1a00000.*nop.* +00000058 e1a00000.*nop.* +0000005c e1a00000.*nop.* +00000060 e1a00000.*nop.* +00000064 e1a00000.*nop.* +00000068 e1a00000.*nop.* +0000006c e1a00000.*nop.* +00000070 e1a00000.*nop.* +00000074 e1a00000.*nop.* +00000078 e1a00000.*nop.* +0000007c e1a00000.*nop.* +00000080 e3a00004.*mov.*r0, #4 +00000084 e1a00000.*nop.* +00000088 e1a00000.*nop.* +0000008c e1a00000.*nop.* +00000090 e1a00000.*nop.* +00000094 e1a00000.*nop.* +00000098 e1a00000.*nop.* +0000009c e1a00000.*nop.* +000000a0 e1a00000.*nop.* +000000a4 e1a00000.*nop.* +000000a8 e1a00000.*nop.* +000000ac e1a00000.*nop.* +000000b0 e1a00000.*nop.* +000000b4 e1a00000.*nop.* +000000b8 e1a00000.*nop.* +000000bc e1a00000.*nop.* diff --git a/gas/testsuite/gas/arm/align64.s b/gas/testsuite/gas/arm/align64.s new file mode 100644 index 00000000000..17135616cd3 --- /dev/null +++ b/gas/testsuite/gas/arm/align64.s @@ -0,0 +1,12 @@ +.syntax unified +.thumb +foo: + mov r0, #1 +.p2align 6,,63 + mov r0, #2 + +.arm +foo2: + mov r0, #3 +.p2align 6,,63 + mov r0, #4