diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch')
-rw-r--r-- | poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch new file mode 100644 index 000000000..f4e38d425 --- /dev/null +++ b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch @@ -0,0 +1,116 @@ +From 9d62544090b08849218cd1fc52a36cdd5d90363e Mon Sep 17 00:00:00 2001 +From: Yuanjie Huang <yuanjie.huang@windriver.com> +Date: Fri, 24 Apr 2015 03:29:31 +0000 +Subject: [PATCH] Add 64-bit flag for ELF64 entries. + +ldconfig-native was grepped from an old version of glibc, and its output +lacks neccessary 64bit flag in entries. +Due to this defect, ctypes.util.find_library() python function fails to +detect any library due to the old file format that ldconfig-native +creates. This fix sets architecture-dependent 64bit flags for 64-bit ELF. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com> +--- + cache.c | 4 ++++ + ldconfig.h | 4 ++++ + readelflib.c | 34 ++++++++++++++++++++++++++++++++++ + 3 files changed, 42 insertions(+) + +diff --git a/cache.c b/cache.c +index a904d44..c4f5411 100644 +--- a/cache.c ++++ b/cache.c +@@ -121,6 +121,10 @@ print_entry (const char *lib, int flag, unsigned int osversion, + break; + case FLAG_MIPS64_LIBN64: + fputs (",64bit", stdout); ++ break; ++ case FLAG_AARCH64_LIB64: ++ fputs (",AArch64", stdout); ++ break; + case 0: + break; + default: +diff --git a/ldconfig.h b/ldconfig.h +index fadd5ec..6a8a750 100644 +--- a/ldconfig.h ++++ b/ldconfig.h +@@ -34,6 +34,10 @@ + #define FLAG_POWERPC_LIB64 0x0500 + #define FLAG_MIPS64_LIBN32 0x0600 + #define FLAG_MIPS64_LIBN64 0x0700 ++#define FLAG_X8664_LIBX32 0x0800 ++#define FLAG_ARM_LIBHF 0x0900 ++#define FLAG_AARCH64_LIB64 0x0a00 ++#define FLAG_ARM_LIBSF 0x0b00 + + /* Name of auxiliary cache. */ + #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache" +diff --git a/readelflib.c b/readelflib.c +index 0bf0de3..6e87afc 100644 +--- a/readelflib.c ++++ b/readelflib.c +@@ -28,6 +28,11 @@ + + #include "endian_extra.h" + ++/* Work-around for old host that does not have AArch64 defined in elf.h. */ ++#ifndef EM_AARCH64 ++#define EM_AARCH64 183 /* ARM AARCH64 */ ++#endif ++ + #undef check_ptr + #define check_ptr(ptr) \ + do \ +@@ -290,6 +295,48 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag, + libc5/libc6. */ + *flag = FLAG_ELF; + ++ /* Set flags according to information in ELF header to align with target ++ ldconfig */ ++ switch (elf_header->e_machine) ++ { ++ case EM_IA_64: ++ /* Intel 64bit libraries are always libc.so.6+. */ ++ /* see sysdeps/unix/sysv/linux/ia64/readelflib.c */ ++ *flag |= FLAG_IA64_LIB64|FLAG_ELF_LIBC6; ++ break; ++ case EM_X86_64: ++ /* X86-64 64bit libraries are always libc.so.6+. */ ++ /* see sysdeps/unix/sysv/linux/i386/readelflib.c */ ++ *flag |= FLAG_X8664_LIB64|FLAG_ELF_LIBC6; ++ break; ++ case EM_S390: ++ /* S/390 64bit libraries are always libc.so.6+. */ ++ /* see sysdeps/unix/sysv/linux/s390/readelflib.c */ ++ *flag |= FLAG_S390_LIB64|FLAG_ELF_LIBC6; ++ break; ++ case EM_PPC64: ++ /* PowerPC 64bit libraries are always libc.so.6+. */ ++ /* see sysdeps/unix/sysv/linux/powerpc/readelflib.c */ ++ *flag |= FLAG_POWERPC_LIB64|FLAG_ELF_LIBC6; ++ break; ++ case EM_MIPS: ++ case EM_MIPS_RS3_LE: ++ /* n64 libraries are always libc.so.6+. */ ++ /* NOTE: This does not correctly distinguish NAN2008 binaries and is possibly broken */ ++ /* see sysdeps/unix/sysv/linux/mips/readelflib.c */ ++ *flag |= FLAG_MIPS64_LIBN64|FLAG_ELF_LIBC6; ++ break; ++ case EM_AARCH64: ++ /* AArch64 libraries are always libc.so.6+. */ ++ /* see sysdeps/unix/sysv/linux/arm/readelflib.c */ ++ *flag |= FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6; ++ break; ++ default: ++ error(0, 0, "%s is a 64-bit ELF for unknown machine %lx\n", ++ file_name, (long)elf_header->e_machine); ++ break; ++ } ++ + loadaddr = -1; + dynamic_addr = 0; + dynamic_size = 0; +-- |