about summary refs log tree commit diff
path: root/ports/sysdeps
diff options
context:
space:
mode:
authorCarlos O'Donell <carlos@redhat.com>2013-02-08 12:26:12 -0500
committerCarlos O'Donell <carlos@redhat.com>2013-02-08 12:26:12 -0500
commitb39949d21179bd0b08a083e4f7e35d0c98e11294 (patch)
tree3e37fa10a3a1146afe9f774d95e8bfedd122eb63 /ports/sysdeps
parenta6ee1783327acdaae31cc4ce700e2983f0175e5d (diff)
downloadglibc-b39949d21179bd0b08a083e4f7e35d0c98e11294.tar.gz
glibc-b39949d21179bd0b08a083e4f7e35d0c98e11294.tar.xz
glibc-b39949d21179bd0b08a083e4f7e35d0c98e11294.zip
ARM: Support loading unmarked objects from cache.
ARM now supports loading unmarked objects from
the dynamic loader cache. Unmarked objects can
be used with the hard-float or soft-float ABI.
We must support loading unmarked objects during
the transition period from a binutils that does
not mark objects to one that does mark them with
the correct ELF flags.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'ports/sysdeps')
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/dl-cache.h9
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/readelflib.c6
2 files changed, 13 insertions, 2 deletions
diff --git a/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h b/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
index acc4f28645..504fecab58 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/dl-cache.h
@@ -18,12 +18,17 @@
 
 #include <ldconfig.h>
 
+/* In order to support the transition from unmarked objects
+   to marked objects we must treat unmarked objects as
+   compatible with either FLAG_ARM_LIBHF or FLAG_ARM_LIBSF.  */
 #ifdef __ARM_PCS_VFP
 # define _dl_cache_check_flags(flags) \
-  ((flags) == (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6))
+  ((flags) == (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6) \
+   || (flags) == FLAG_ELF_LIBC6)
 #else
 # define _dl_cache_check_flags(flags) \
-  ((flags) == FLAG_ELF_LIBC6)
+  ((flags) == (FLAG_ARM_LIBSF | FLAG_ELF_LIBC6) \
+   || (flags) == FLAG_ELF_LIBC6)
 #endif
 
 #include_next <dl-cache.h>
diff --git a/ports/sysdeps/unix/sysv/linux/arm/readelflib.c b/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
index 81e5ccb55f..3efb6134c3 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
+++ b/ports/sysdeps/unix/sysv/linux/arm/readelflib.c
@@ -46,6 +46,12 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
 	  if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD)
 	    *flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6;
 	  else if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_SOFT)
+	    *flag = FLAG_ARM_LIBSF|FLAG_ELF_LIBC6;
+	  else
+	    /* We must assume the unmarked objects are compatible
+	       with all ABI variants. Such objects may have been
+	       generated in a transitional period when the ABI
+	       tags were not added to all objects.  */
 	    *flag = FLAG_ELF_LIBC6;
 	}
     }