Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys GNU as on ARM silently accepts @progbits, but interp...



details:   https://anonhg.NetBSD.org/src/rev/ea20d8bf42c1
branches:  trunk
changeset: 1009686:ea20d8bf42c1
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Apr 30 14:32:05 2020 +0000

description:
GNU as on ARM silently accepts @progbits, but interpretes it as comment
internally. LLVM bails out on the other hand. So conditionally this
properly.

diffstat:

 sys/sys/cdefs_elf.h |  22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diffs (43 lines):

diff -r 1e95d634b9fb -r ea20d8bf42c1 sys/sys/cdefs_elf.h
--- a/sys/sys/cdefs_elf.h       Thu Apr 30 14:04:54 2020 +0000
+++ b/sys/sys/cdefs_elf.h       Thu Apr 30 14:32:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdefs_elf.h,v 1.56 2020/04/17 14:19:44 joerg Exp $     */
+/*     $NetBSD: cdefs_elf.h,v 1.57 2020/04/30 14:32:05 joerg Exp $     */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -134,16 +134,30 @@
              _C_LABEL_STRING(#name) " = " _C_LABEL_STRING(#resolver))
 #endif
 
+#ifdef __arm__
 #if __STDC__
-#define        __SECTIONSTRING(_sec, _str)                                     \
+#  define      __SECTIONSTRING(_sec, _str)                                     \
+       __asm(".pushsection " #_sec ",\"MS\",%progbits,1\n"             \
+             ".asciz \"" _str "\"\n"                                   \
+             ".popsection")
+#else
+#  define      __SECTIONSTRING(_sec, _str)                                     \
+       __asm(".pushsection " _sec ",\"MS\",%progbits,1\n"              \
+             ".asciz \"" _str "\"\n"                                   \
+             ".popsection")
+#  endif
+#else
+#  if __STDC__
+#  define      __SECTIONSTRING(_sec, _str)                                     \
        __asm(".pushsection " #_sec ",\"MS\",@progbits,1\n"             \
              ".asciz \"" _str "\"\n"                                   \
              ".popsection")
-#else
-#define        __SECTIONSTRING(_sec, _str)                                     \
+#  else
+#  define      __SECTIONSTRING(_sec, _str)                                     \
        __asm(".pushsection " _sec ",\"MS\",@progbits,1\n"              \
              ".asciz \"" _str "\"\n"                                   \
              ".popsection")
+#  endif
 #endif
 
 #define        __IDSTRING(_n,_s)               __SECTIONSTRING(.ident,_s)



Home | Main Index | Thread Index | Old Index