db7fd60
#
db7fd60
# Red Hat BZ:
db7fd60
# https://bugzilla.redhat.com/show_bug.cgi?id=905184
db7fd60
#
db7fd60
# Sourcware BZ:
db7fd60
# http://sourceware.org/bugzilla/show_bug.cgi?id=15006
db7fd60
#
db7fd60
# Upstream submission:
db7fd60
# http://www.sourceware.org/ml/libc-alpha/2013-02/msg00120.html
db7fd60
#
db7fd60
# ChangeLog
db7fd60
#
db7fd60
# 2013-02-07  Carlos O'Donell  <carlos@redhat.com>
db7fd60
#
db7fd60
#	* sysdeps/generic/ldconfig.h: Define FLAG_ARM_LIBSF.
db7fd60
#	* elf/cache.c (print_entry): Add FLAG_ARM_LIBSF support.
db7fd60
#
db7fd60
# ports/ChangeLog.arm
db7fd60
#
db7fd60
# 2013-02-07  Carlos O'Donell  <carlos@redhat.com>
db7fd60
#
db7fd60
#	* sysdeps/unix/sysv/linux/arm/dl-cache.h
db7fd60
#	[__ARM_PCS_VFP] (_dl_cache_check_flags): Allow plain FLAG_ELF_LIBC6.
db7fd60
#	[!__ARM_PCS_VFP] (_dl_cache_check_flags): Likewise.
db7fd60
#	* sysdeps/unix/sysv/linux/arm/readelflib.c (process_elf_file):
db7fd60
#	Set FLAG_ARM_LIBSF for soft-float ABI otherwise just FLAG_ELF_LIBC6.
db7fd60
#
db7fd60
diff --git a/elf/cache.c b/elf/cache.c
db7fd60
index 9901952..699550b 100644
db7fd60
--- a/elf/cache.c
db7fd60
+++ b/elf/cache.c
db7fd60
@@ -100,6 +100,10 @@ print_entry (const char *lib, int flag, unsigned int osversion,
db7fd60
     case FLAG_AARCH64_LIB64:
db7fd60
       fputs (",AArch64", stdout);
db7fd60
       break;
db7fd60
+    /* Uses the ARM soft-float ABI.  */
db7fd60
+    case FLAG_ARM_LIBSF:
db7fd60
+      fputs (",soft-float", stdout);
db7fd60
+      break;
db7fd60
     case 0:
db7fd60
       break;
db7fd60
     default:
db7fd60
diff --git a/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h b/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
db7fd60
index acc4f28..504feca 100644
db7fd60
--- a/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
db7fd60
+++ b/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
db7fd60
@@ -18,12 +18,17 @@
db7fd60
 
db7fd60
 #include <ldconfig.h>
db7fd60
 
db7fd60
+/* In order to support the transition from unmarked objects
db7fd60
+   to marked objects we must treat unmarked objects as
db7fd60
+   compatible with either FLAG_ARM_LIBHF or FLAG_ARM_LIBSF.  */
db7fd60
 #ifdef __ARM_PCS_VFP
db7fd60
 # define _dl_cache_check_flags(flags) \
db7fd60
-  ((flags) == (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6))
db7fd60
+  ((flags) == (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6) \
db7fd60
+   || (flags) == FLAG_ELF_LIBC6)
db7fd60
 #else
db7fd60
 # define _dl_cache_check_flags(flags) \
db7fd60
-  ((flags) == FLAG_ELF_LIBC6)
db7fd60
+  ((flags) == (FLAG_ARM_LIBSF | FLAG_ELF_LIBC6) \
db7fd60
+   || (flags) == FLAG_ELF_LIBC6)
db7fd60
 #endif
db7fd60
 
db7fd60
 #include_next <dl-cache.h>
db7fd60
diff --git a/ports/sysdeps/unix/sysv/linux/arm/readelflib.c b/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
db7fd60
index 81e5ccb..3efb613 100644
db7fd60
--- a/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
db7fd60
+++ b/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
db7fd60
@@ -46,6 +46,12 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
db7fd60
 	  if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD)
db7fd60
 	    *flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6;
db7fd60
 	  else if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_SOFT)
db7fd60
+	    *flag = FLAG_ARM_LIBSF|FLAG_ELF_LIBC6;
db7fd60
+	  else
db7fd60
+	    /* We must assume the unmarked objects are compatible
db7fd60
+	       with all ABI variants. Such objects may have been
db7fd60
+	       generated in a transitional period when the ABI
db7fd60
+	       tags were not added to all objects.  */
db7fd60
 	    *flag = FLAG_ELF_LIBC6;
db7fd60
 	}
db7fd60
     }
db7fd60
diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
db7fd60
index 57a9a46..91190aa 100644
db7fd60
--- a/sysdeps/generic/ldconfig.h
db7fd60
+++ b/sysdeps/generic/ldconfig.h
db7fd60
@@ -36,6 +36,7 @@
db7fd60
 #define FLAG_X8664_LIBX32	0x0800
db7fd60
 #define FLAG_ARM_LIBHF		0x0900
db7fd60
 #define FLAG_AARCH64_LIB64	0x0a00
db7fd60
+#define FLAG_ARM_LIBSF		0x0b00
db7fd60
 
db7fd60
 /* Name of auxiliary cache.  */
db7fd60
 #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"