This fixes two isses.

1. In GNU as, .align 0 is equivalent to .align 2, but with clang's
   internal assembler .align 0 means "no alignment".

2. Using "ldr" to load a constant into a register is strange.  It
   works with GNU as, but not with clang.

No binary change in a kernel compiled with gcc.

ok?


Index: arch/arm/arm/bcopyinout.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/bcopyinout.S,v
retrieving revision 1.5
diff -u -p -r1.5 bcopyinout.S
--- arch/arm/arm/bcopyinout.S   25 Apr 2016 04:46:56 -0000      1.5
+++ arch/arm/arm/bcopyinout.S   21 Sep 2016 08:06:23 -0000
@@ -46,7 +46,7 @@
 #else
 
        .text
-       .align  0
+       .align  2
 
 #ifdef MULTIPROCESSOR
 .Lcpu_info:
Index: arch/arm/arm/bus_space_notimpl.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/bus_space_notimpl.S,v
retrieving revision 1.2
diff -u -p -r1.2 bus_space_notimpl.S
--- arch/arm/arm/bus_space_notimpl.S    27 May 2007 16:10:39 -0000      1.2
+++ arch/arm/arm/bus_space_notimpl.S    21 Sep 2016 08:06:23 -0000
@@ -65,7 +65,7 @@ LLABEL(__C(func,_text))                                       
        ;       \
        .align  0                                               ;
 
 bs_notimpl_message:
-        .asciz  __S(BUS_SPACE) "_%s: args at %p"
+        .asciz  __S(BUS_SPACE), "_%s: args at %p"
 
        .align  2
 bs_notimpl_panic:
Index: arch/arm/arm/copystr.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/copystr.S,v
retrieving revision 1.6
diff -u -p -r1.6 copystr.S
--- arch/arm/arm/copystr.S      25 Apr 2016 04:46:56 -0000      1.6
+++ arch/arm/arm/copystr.S      21 Sep 2016 08:06:23 -0000
@@ -45,7 +45,7 @@
 #include <sys/errno.h>
 
        .text
-       .align  0
+       .align  2
 #ifdef MULTIPROCESSOR
 .Lcpu_info:
        .word   _C_LABEL(cpu_info)
@@ -210,5 +210,5 @@ ENTRY(copyoutstr)
 
 Lcopystrpcbfaulttext:
        .asciz  "No valid PCB during copyinoutstr() addr1=%08x addr2=%08x\n"
-       .align  0
+       .align  2
 #endif
Index: arch/arm/arm/cpufunc_asm.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/cpufunc_asm.S,v
retrieving revision 1.4
diff -u -p -r1.4 cpufunc_asm.S
--- arch/arm/arm/cpufunc_asm.S  25 Apr 2016 04:46:56 -0000      1.4
+++ arch/arm/arm/cpufunc_asm.S  21 Sep 2016 08:06:23 -0000
@@ -47,7 +47,7 @@
 #include <arm/sysreg.h>
 
        .text
-       .align  0
+       .align  2
 
 ENTRY(cpufunc_nullop)
        mov     pc, lr
Index: arch/arm/arm/exception.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/exception.S,v
retrieving revision 1.5
diff -u -p -r1.5 exception.S
--- arch/arm/arm/exception.S    18 Jan 2015 12:03:11 -0000      1.5
+++ arch/arm/arm/exception.S    21 Sep 2016 08:06:23 -0000
@@ -52,7 +52,7 @@
 #include "assym.h"
 
        .text   
-       .align  0
+       .align  2
 
 AST_LOCALS
 
@@ -120,7 +120,7 @@ abortprefetch:
 
 abortprefetchmsg:
         .asciz  "abortprefetch"
-        .align  0
+        .align  2
 
 /*
  * data_abort_entry:
@@ -157,7 +157,7 @@ abortdata:
 
 abortdatamsg:
         .asciz  "abortdata"
-        .align  0
+        .align  2
 
 /*
  * address_exception_entry:
@@ -231,7 +231,7 @@ ENTRY_NP(undefinedinstruction_bounce)
        b       _C_LABEL(undefinedinstruction)
 
        .data
-       .align  0
+       .align  2
 
 /*
  * Indirection data
Index: arch/arm/arm/irq_dispatch.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/irq_dispatch.S,v
retrieving revision 1.11
diff -u -p -r1.11 irq_dispatch.S
--- arch/arm/arm/irq_dispatch.S 25 Apr 2016 04:46:56 -0000      1.11
+++ arch/arm/arm/irq_dispatch.S 21 Sep 2016 08:06:23 -0000
@@ -86,7 +86,7 @@
  *     which can be used by different platforms.
  */
        .text
-       .align  0
+       .align  2
 .Lcpu_info_primary:
        .word   _C_LABEL(cpu_info_primary)
 
@@ -129,7 +129,7 @@ ASENTRY_NP(irq_entry)
        movs    pc, lr                  /* Exit */
 
        .bss
-       .align  0
+       .align  2
 
        .global _C_LABEL(astpending)
 _C_LABEL(astpending):
Index: arch/arm/arm/locore.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/locore.S,v
retrieving revision 1.10
diff -u -p -r1.10 locore.S
--- arch/arm/arm/locore.S       25 Apr 2016 04:46:56 -0000      1.10
+++ arch/arm/arm/locore.S       21 Sep 2016 08:06:23 -0000
@@ -49,7 +49,7 @@
  */
 
        .text
-       .align  0
+       .align  2
 
 ENTRY_NP(kernel_text)
 
@@ -98,14 +98,14 @@ ASENTRY_NP(start)
 
 .Lmainreturned:
        .asciz  "main() returned"
-       .align  0
+       .align  2
 
        .bss
 svcstk:
        .space  INIT_ARM_STACK_SIZE
 
        .text
-       .align  0
+       .align  2
 
 #ifndef OFW
        /* OFW based systems will use OF_boot() */
Index: arch/arm/arm/sigcode.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/sigcode.S,v
retrieving revision 1.4
diff -u -p -r1.4 sigcode.S
--- arch/arm/arm/sigcode.S      23 May 2016 20:11:49 -0000      1.4
+++ arch/arm/arm/sigcode.S      21 Sep 2016 08:06:23 -0000
@@ -42,7 +42,7 @@
  */
 
        .section .rodata
-       .align  0
+       .align  2
        .globl  sigcode
        .type   x,_ASM_TYPE_FUNCTION
 sigcode:
@@ -54,7 +54,7 @@ sigcode:
  */
 /*     mov     r0, sp */
        add     r0, sp, #SIGF_SC
-       ldr     r12, =SYS_sigreturn
+       mov     r12, #SYS_sigreturn
        swi     SYS_sigreturn
        .globl  _C_LABEL(sigcoderet)
 _C_LABEL(sigcoderet):
@@ -64,7 +64,7 @@ _C_LABEL(sigcoderet):
        swi     SYS_exit
        b       . - 8
 
-       .align  0
+       .align  2
         .global _C_LABEL(esigcode)
 _C_LABEL(esigcode):
 
Index: arch/arm/arm/vectors.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/vectors.S,v
retrieving revision 1.1
diff -u -p -r1.1 vectors.S
--- arch/arm/arm/vectors.S      1 Feb 2004 05:09:48 -0000       1.1
+++ arch/arm/arm/vectors.S      21 Sep 2016 08:06:23 -0000
@@ -44,7 +44,7 @@
  */
 
        .text
-       .align  0
+       .align  2
        .global _C_LABEL(page0), _C_LABEL(page0_data), _C_LABEL(page0_end)
        .global _C_LABEL(fiqvector)
 
@@ -97,7 +97,7 @@ _C_LABEL(page0_end):
 
 #ifdef __ARM_FIQ_INDIRECT
        .data
-       .align  0
+       .align  2
 _C_LABEL(fiqvector):
        subs    pc, lr, #4
        .org    _C_LABEL(fiqvector) + 0x100
Index: arch/arm/include/asm.h
===================================================================
RCS file: /cvs/src/sys/arch/arm/include/asm.h,v
retrieving revision 1.6
diff -u -p -r1.6 asm.h
--- arch/arm/include/asm.h      27 May 2016 16:32:38 -0000      1.6
+++ arch/arm/include/asm.h      21 Sep 2016 08:06:23 -0000
@@ -50,7 +50,7 @@
 #endif
 
 #ifndef _ALIGN_TEXT
-# define _ALIGN_TEXT .align 0
+# define _ALIGN_TEXT .align 2
 #endif
 
 /*
Index: arch/arm/include/profile.h
===================================================================
RCS file: /cvs/src/sys/arch/arm/include/profile.h,v
retrieving revision 1.4
diff -u -p -r1.4 profile.h
--- arch/arm/include/profile.h  27 May 2016 16:32:38 -0000      1.4
+++ arch/arm/include/profile.h  21 Sep 2016 08:06:23 -0000
@@ -50,7 +50,7 @@
 
 #define        MCOUNT                                                          
\
        __asm__(".text");                                               \
-       __asm__(".align 0");                                            \
+       __asm__(".align 2");                                            \
        __asm__(".type  " MCOUNT_ASM_NAME ",%function");                \
        __asm__(".global        " MCOUNT_ASM_NAME);                     \
        __asm__(MCOUNT_ASM_NAME ":");                                   \

Reply via email to