diff options
| author | Nitin A Kamble <nitin.a.kamble@intel.com> | 2011-03-29 12:55:18 -0700 |
|---|---|---|
| committer | Saul Wold <sgw@linux.intel.com> | 2011-05-06 17:44:22 -0700 |
| commit | 9361df5ec235435f71774f3f93812f52af6f0a2e (patch) | |
| tree | d033c8c519c5b43184d19dc3b8c3cd8b4f082cf0 /meta/recipes-core/glibc | |
| parent | 5ec8233e2f2892b7746564724fbac738ed19450d (diff) | |
| download | poky-9361df5ec235435f71774f3f93812f52af6f0a2e.tar.gz | |
ldconfig-native-2.12.1: newer recipe with eglibc sources
This fixes [YOCTO #780]
Handle the input/output data with different endian-ness correctly
Also fix the definition of LD_SO for cross environment
And remove the older 2.5 version of ldconfig-native recipe
(From OE-Core rev: 694db055f3729662e0e0193a31f2098be599877f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glibc')
| -rw-r--r-- | meta/recipes-core/glibc/ldconfig-native-2.5/32and64bit.patch | 289 | ||||
| -rw-r--r-- | meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig-native-2.5.tar.bz2 | bin | 19454 -> 0 bytes | |||
| -rw-r--r-- | meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig.patch | 460 | ||||
| -rw-r--r-- | meta/recipes-core/glibc/ldconfig-native_2.5.bb | 24 |
4 files changed, 0 insertions, 773 deletions
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.5/32and64bit.patch b/meta/recipes-core/glibc/ldconfig-native-2.5/32and64bit.patch deleted file mode 100644 index 4f8d3a39ca..0000000000 --- a/meta/recipes-core/glibc/ldconfig-native-2.5/32and64bit.patch +++ /dev/null | |||
| @@ -1,289 +0,0 @@ | |||
| 1 | Index: ldconfig-native-2.5/readelflib.c | ||
| 2 | =================================================================== | ||
| 3 | --- ldconfig-native-2.5.orig/readelflib.c 2009-05-19 09:40:17.000000000 +0100 | ||
| 4 | +++ ldconfig-native-2.5/readelflib.c 2009-05-19 09:56:18.000000000 +0100 | ||
| 5 | @@ -40,38 +40,190 @@ | ||
| 6 | |||
| 7 | /* Returns 0 if everything is ok, != 0 in case of error. */ | ||
| 8 | int | ||
| 9 | -process_elf_file (const char *file_name, const char *lib, int *flag, | ||
| 10 | +process_elf_file32 (const char *file_name, const char *lib, int *flag, | ||
| 11 | unsigned int *osversion, char **soname, void *file_contents, | ||
| 12 | size_t file_length) | ||
| 13 | { | ||
| 14 | int i; | ||
| 15 | unsigned int j; | ||
| 16 | - ElfW(Addr) loadaddr; | ||
| 17 | + Elf32_Addr loadaddr; | ||
| 18 | unsigned int dynamic_addr; | ||
| 19 | size_t dynamic_size; | ||
| 20 | char *program_interpreter; | ||
| 21 | |||
| 22 | - ElfW(Ehdr) *elf_header; | ||
| 23 | - ElfW(Phdr) *elf_pheader, *segment; | ||
| 24 | - ElfW(Dyn) *dynamic_segment, *dyn_entry; | ||
| 25 | + Elf32_Ehdr *elf_header; | ||
| 26 | + Elf32_Phdr *elf_pheader, *segment; | ||
| 27 | + Elf32_Dyn *dynamic_segment, *dyn_entry; | ||
| 28 | char *dynamic_strings; | ||
| 29 | |||
| 30 | - elf_header = (ElfW(Ehdr) *) file_contents; | ||
| 31 | + elf_header = (Elf32_Ehdr *) file_contents; | ||
| 32 | *osversion = 0; | ||
| 33 | |||
| 34 | - if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS)) | ||
| 35 | + if (elf_header->e_type != ET_DYN) | ||
| 36 | + { | ||
| 37 | + error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name, | ||
| 38 | + elf_header->e_type); | ||
| 39 | + return 1; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + /* Get information from elf program header. */ | ||
| 43 | + elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents); | ||
| 44 | + check_ptr (elf_pheader); | ||
| 45 | + | ||
| 46 | + /* The library is an elf library, now search for soname and | ||
| 47 | + libc5/libc6. */ | ||
| 48 | + *flag = FLAG_ELF; | ||
| 49 | + | ||
| 50 | + loadaddr = -1; | ||
| 51 | + dynamic_addr = 0; | ||
| 52 | + dynamic_size = 0; | ||
| 53 | + program_interpreter = NULL; | ||
| 54 | + for (i = 0, segment = elf_pheader; | ||
| 55 | + i < elf_header->e_phnum; i++, segment++) | ||
| 56 | { | ||
| 57 | - if (opt_verbose) | ||
| 58 | + check_ptr (segment); | ||
| 59 | + | ||
| 60 | + switch (segment->p_type) | ||
| 61 | { | ||
| 62 | - if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) | ||
| 63 | - error (0, 0, _("%s is a 32 bit ELF file.\n"), file_name); | ||
| 64 | - else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64) | ||
| 65 | - error (0, 0, _("%s is a 64 bit ELF file.\n"), file_name); | ||
| 66 | - else | ||
| 67 | - error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name); | ||
| 68 | + case PT_LOAD: | ||
| 69 | + if (loadaddr == (Elf32_Addr) -1) | ||
| 70 | + loadaddr = segment->p_vaddr - segment->p_offset; | ||
| 71 | + break; | ||
| 72 | + | ||
| 73 | + case PT_DYNAMIC: | ||
| 74 | + if (dynamic_addr) | ||
| 75 | + error (0, 0, _("more than one dynamic segment\n")); | ||
| 76 | + | ||
| 77 | + dynamic_addr = segment->p_offset; | ||
| 78 | + dynamic_size = segment->p_filesz; | ||
| 79 | + break; | ||
| 80 | + | ||
| 81 | + case PT_INTERP: | ||
| 82 | + program_interpreter = (char *) (file_contents + segment->p_offset); | ||
| 83 | + check_ptr (program_interpreter); | ||
| 84 | + | ||
| 85 | + /* Check if this is enough to classify the binary. */ | ||
| 86 | + for (j = 0; j < sizeof (interpreters) / sizeof (interpreters [0]); | ||
| 87 | + ++j) | ||
| 88 | + if (strcmp (program_interpreter, interpreters[j].soname) == 0) | ||
| 89 | + { | ||
| 90 | + *flag = interpreters[j].flag; | ||
| 91 | + break; | ||
| 92 | + } | ||
| 93 | + break; | ||
| 94 | + | ||
| 95 | + case PT_NOTE: | ||
| 96 | + if (!*osversion && segment->p_filesz == 32 && segment->p_align >= 4) | ||
| 97 | + { | ||
| 98 | + Elf32_Word *abi_note = (Elf32_Word *) (file_contents | ||
| 99 | + + segment->p_offset); | ||
| 100 | + if (abi_note [0] == 4 && abi_note [1] == 16 && abi_note [2] == 1 | ||
| 101 | + && memcmp (abi_note + 3, "GNU", 4) == 0) | ||
| 102 | + *osversion = (abi_note [4] << 24) | | ||
| 103 | + ((abi_note [5] & 0xff) << 16) | | ||
| 104 | + ((abi_note [6] & 0xff) << 8) | | ||
| 105 | + (abi_note [7] & 0xff); | ||
| 106 | + } | ||
| 107 | + break; | ||
| 108 | + | ||
| 109 | + default: | ||
| 110 | + break; | ||
| 111 | } | ||
| 112 | - return 1; | ||
| 113 | + | ||
| 114 | } | ||
| 115 | + if (loadaddr == (Elf32_Addr) -1) | ||
| 116 | + { | ||
| 117 | + /* Very strange. */ | ||
| 118 | + loadaddr = 0; | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + /* Now we can read the dynamic sections. */ | ||
| 122 | + if (dynamic_size == 0) | ||
| 123 | + return 1; | ||
| 124 | + | ||
| 125 | + dynamic_segment = (Elf32_Dyn *) (file_contents + dynamic_addr); | ||
| 126 | + check_ptr (dynamic_segment); | ||
| 127 | + | ||
| 128 | + /* Find the string table. */ | ||
| 129 | + dynamic_strings = NULL; | ||
| 130 | + for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; | ||
| 131 | + ++dyn_entry) | ||
| 132 | + { | ||
| 133 | + check_ptr (dyn_entry); | ||
| 134 | + if (dyn_entry->d_tag == DT_STRTAB) | ||
| 135 | + { | ||
| 136 | + dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr); | ||
| 137 | + check_ptr (dynamic_strings); | ||
| 138 | + break; | ||
| 139 | + } | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + if (dynamic_strings == NULL) | ||
| 143 | + return 1; | ||
| 144 | + | ||
| 145 | + /* Now read the DT_NEEDED and DT_SONAME entries. */ | ||
| 146 | + for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; | ||
| 147 | + ++dyn_entry) | ||
| 148 | + { | ||
| 149 | + if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME) | ||
| 150 | + { | ||
| 151 | + char *name = dynamic_strings + dyn_entry->d_un.d_val; | ||
| 152 | + check_ptr (name); | ||
| 153 | + | ||
| 154 | + if (dyn_entry->d_tag == DT_NEEDED) | ||
| 155 | + { | ||
| 156 | + | ||
| 157 | + if (*flag == FLAG_ELF) | ||
| 158 | + { | ||
| 159 | + /* Check if this is enough to classify the binary. */ | ||
| 160 | + for (j = 0; | ||
| 161 | + j < sizeof (known_libs) / sizeof (known_libs [0]); | ||
| 162 | + ++j) | ||
| 163 | + if (strcmp (name, known_libs [j].soname) == 0) | ||
| 164 | + { | ||
| 165 | + *flag = known_libs [j].flag; | ||
| 166 | + break; | ||
| 167 | + } | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + else if (dyn_entry->d_tag == DT_SONAME) | ||
| 172 | + *soname = xstrdup (name); | ||
| 173 | + | ||
| 174 | + /* Do we have everything we need? */ | ||
| 175 | + if (*soname && *flag != FLAG_ELF) | ||
| 176 | + return 0; | ||
| 177 | + } | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + /* We reach this point only if the file doesn't contain a DT_SONAME | ||
| 181 | + or if we can't classify the library. If it doesn't have a | ||
| 182 | + soname, return the name of the library. */ | ||
| 183 | + if (*soname == NULL) | ||
| 184 | + *soname = xstrdup (lib); | ||
| 185 | + | ||
| 186 | + return 0; | ||
| 187 | +} | ||
| 188 | + | ||
| 189 | +int | ||
| 190 | +process_elf_file64 (const char *file_name, const char *lib, int *flag, | ||
| 191 | + unsigned int *osversion, char **soname, void *file_contents, | ||
| 192 | + size_t file_length) | ||
| 193 | +{ | ||
| 194 | + int i; | ||
| 195 | + unsigned int j; | ||
| 196 | + Elf64_Addr loadaddr; | ||
| 197 | + unsigned int dynamic_addr; | ||
| 198 | + size_t dynamic_size; | ||
| 199 | + char *program_interpreter; | ||
| 200 | + | ||
| 201 | + Elf64_Ehdr *elf_header; | ||
| 202 | + Elf64_Phdr *elf_pheader, *segment; | ||
| 203 | + Elf64_Dyn *dynamic_segment, *dyn_entry; | ||
| 204 | + char *dynamic_strings; | ||
| 205 | + | ||
| 206 | + elf_header = (Elf64_Ehdr *) file_contents; | ||
| 207 | + *osversion = 0; | ||
| 208 | |||
| 209 | if (elf_header->e_type != ET_DYN) | ||
| 210 | { | ||
| 211 | @@ -81,7 +233,7 @@ | ||
| 212 | } | ||
| 213 | |||
| 214 | /* Get information from elf program header. */ | ||
| 215 | - elf_pheader = (ElfW(Phdr) *) (elf_header->e_phoff + file_contents); | ||
| 216 | + elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents); | ||
| 217 | check_ptr (elf_pheader); | ||
| 218 | |||
| 219 | /* The library is an elf library, now search for soname and | ||
| 220 | @@ -100,7 +252,7 @@ | ||
| 221 | switch (segment->p_type) | ||
| 222 | { | ||
| 223 | case PT_LOAD: | ||
| 224 | - if (loadaddr == (ElfW(Addr)) -1) | ||
| 225 | + if (loadaddr == (Elf64_Addr) -1) | ||
| 226 | loadaddr = segment->p_vaddr - segment->p_offset; | ||
| 227 | break; | ||
| 228 | |||
| 229 | @@ -129,7 +281,7 @@ | ||
| 230 | case PT_NOTE: | ||
| 231 | if (!*osversion && segment->p_filesz == 32 && segment->p_align >= 4) | ||
| 232 | { | ||
| 233 | - ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents | ||
| 234 | + Elf64_Word *abi_note = (Elf64_Word *) (file_contents | ||
| 235 | + segment->p_offset); | ||
| 236 | if (abi_note [0] == 4 && abi_note [1] == 16 && abi_note [2] == 1 | ||
| 237 | && memcmp (abi_note + 3, "GNU", 4) == 0) | ||
| 238 | @@ -145,7 +297,7 @@ | ||
| 239 | } | ||
| 240 | |||
| 241 | } | ||
| 242 | - if (loadaddr == (ElfW(Addr)) -1) | ||
| 243 | + if (loadaddr == (Elf64_Addr) -1) | ||
| 244 | { | ||
| 245 | /* Very strange. */ | ||
| 246 | loadaddr = 0; | ||
| 247 | @@ -155,7 +307,7 @@ | ||
| 248 | if (dynamic_size == 0) | ||
| 249 | return 1; | ||
| 250 | |||
| 251 | - dynamic_segment = (ElfW(Dyn) *) (file_contents + dynamic_addr); | ||
| 252 | + dynamic_segment = (Elf64_Dyn *) (file_contents + dynamic_addr); | ||
| 253 | check_ptr (dynamic_segment); | ||
| 254 | |||
| 255 | /* Find the string table. */ | ||
| 256 | @@ -218,3 +370,33 @@ | ||
| 257 | |||
| 258 | return 0; | ||
| 259 | } | ||
| 260 | +/* Returns 0 if everything is ok, != 0 in case of error. */ | ||
| 261 | +int | ||
| 262 | +process_elf_file (const char *file_name, const char *lib, int *flag, | ||
| 263 | + unsigned int *osversion, char **soname, void *file_contents, | ||
| 264 | + size_t file_length) | ||
| 265 | +{ | ||
| 266 | + int i; | ||
| 267 | + unsigned int j; | ||
| 268 | + ElfW(Addr) loadaddr; | ||
| 269 | + unsigned int dynamic_addr; | ||
| 270 | + size_t dynamic_size; | ||
| 271 | + char *program_interpreter; | ||
| 272 | + | ||
| 273 | + ElfW(Ehdr) *elf_header; | ||
| 274 | + ElfW(Phdr) *elf_pheader, *segment; | ||
| 275 | + ElfW(Dyn) *dynamic_segment, *dyn_entry; | ||
| 276 | + char *dynamic_strings; | ||
| 277 | + | ||
| 278 | + elf_header = (ElfW(Ehdr) *) file_contents; | ||
| 279 | + *osversion = 0; | ||
| 280 | + | ||
| 281 | + if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) | ||
| 282 | + return process_elf_file32(file_name, lib,flag, osversion, soname, file_contents, file_length); | ||
| 283 | + else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64) | ||
| 284 | + return process_elf_file64(file_name, lib,flag, osversion, soname, file_contents, file_length); | ||
| 285 | + error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name); | ||
| 286 | + return 1; | ||
| 287 | +} | ||
| 288 | + | ||
| 289 | + | ||
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig-native-2.5.tar.bz2 b/meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig-native-2.5.tar.bz2 deleted file mode 100644 index 693b35ced2..0000000000 --- a/meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig-native-2.5.tar.bz2 +++ /dev/null | |||
| Binary files differ | |||
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig.patch b/meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig.patch deleted file mode 100644 index d143a075f5..0000000000 --- a/meta/recipes-core/glibc/ldconfig-native-2.5/ldconfig.patch +++ /dev/null | |||
| @@ -1,460 +0,0 @@ | |||
| 1 | --- | ||
| 2 | cache.c | 11 +- | ||
| 3 | chroot_canon.c | 7 + | ||
| 4 | dl-cache.c | 235 --------------------------------------------------------- | ||
| 5 | dl-cache.h | 3 | ||
| 6 | ldconfig.c | 27 ++++-- | ||
| 7 | readlib.c | 7 + | ||
| 8 | xstrdup.c | 11 -- | ||
| 9 | 7 files changed, 45 insertions(+), 256 deletions(-) | ||
| 10 | |||
| 11 | Index: 1/cache.c | ||
| 12 | =================================================================== | ||
| 13 | --- 1.orig/cache.c 2007-11-23 17:05:44.000000000 +0000 | ||
| 14 | +++ 1/cache.c 2007-11-23 17:05:56.000000000 +0000 | ||
| 15 | @@ -15,6 +15,9 @@ | ||
| 16 | along with this program; if not, write to the Free Software Foundation, | ||
| 17 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | ||
| 18 | |||
| 19 | +#define _LARGEFILE64_SOURCE | ||
| 20 | +#define _GNU_SOURCE | ||
| 21 | + | ||
| 22 | #include <errno.h> | ||
| 23 | #include <error.h> | ||
| 24 | #include <dirent.h> | ||
| 25 | @@ -29,8 +32,10 @@ | ||
| 26 | #include <sys/stat.h> | ||
| 27 | #include <sys/types.h> | ||
| 28 | |||
| 29 | -#include <ldconfig.h> | ||
| 30 | -#include <dl-cache.h> | ||
| 31 | +#include "ldconfig.h" | ||
| 32 | +#include "dl-cache.h" | ||
| 33 | +# define N_(msgid) msgid | ||
| 34 | +#define _(msg) msg | ||
| 35 | |||
| 36 | struct cache_entry | ||
| 37 | { | ||
| 38 | @@ -230,8 +235,6 @@ init_cache (void) | ||
| 39 | entries = NULL; | ||
| 40 | } | ||
| 41 | |||
| 42 | - | ||
| 43 | - | ||
| 44 | static | ||
| 45 | int compare (const struct cache_entry *e1, const struct cache_entry *e2) | ||
| 46 | { | ||
| 47 | Index: 1/chroot_canon.c | ||
| 48 | =================================================================== | ||
| 49 | --- 1.orig/chroot_canon.c 2007-11-23 17:05:44.000000000 +0000 | ||
| 50 | +++ 1/chroot_canon.c 2007-11-23 17:05:56.000000000 +0000 | ||
| 51 | @@ -16,6 +16,9 @@ | ||
| 52 | along with this program; if not, write to the Free Software Foundation, | ||
| 53 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | ||
| 54 | |||
| 55 | +#define _LARGEFILE64_SOURCE | ||
| 56 | +#define _GNU_SOURCE | ||
| 57 | + | ||
| 58 | #include <stdlib.h> | ||
| 59 | #include <string.h> | ||
| 60 | #include <unistd.h> | ||
| 61 | @@ -26,7 +29,9 @@ | ||
| 62 | #include <stddef.h> | ||
| 63 | #include <stdint.h> | ||
| 64 | |||
| 65 | -#include <ldconfig.h> | ||
| 66 | +#include "ldconfig.h" | ||
| 67 | + | ||
| 68 | +#define __set_errno(Val) errno = (Val) | ||
| 69 | |||
| 70 | #ifndef PATH_MAX | ||
| 71 | #define PATH_MAX 1024 | ||
| 72 | Index: 1/dl-cache.c | ||
| 73 | =================================================================== | ||
| 74 | --- 1.orig/dl-cache.c 2007-11-23 17:05:44.000000000 +0000 | ||
| 75 | +++ 1/dl-cache.c 2007-11-23 17:05:56.000000000 +0000 | ||
| 76 | @@ -19,12 +19,12 @@ | ||
| 77 | |||
| 78 | #include <assert.h> | ||
| 79 | #include <unistd.h> | ||
| 80 | -#include <ldsodefs.h> | ||
| 81 | +//#include "ldsodefs.h" | ||
| 82 | #include <sys/mman.h> | ||
| 83 | #include <dl-cache.h> | ||
| 84 | #include <dl-procinfo.h> | ||
| 85 | |||
| 86 | -#include <stdio-common/_itoa.h> | ||
| 87 | +//#include "_itoa.h" | ||
| 88 | |||
| 89 | #ifndef _DL_PLATFORMS_COUNT | ||
| 90 | # define _DL_PLATFORMS_COUNT 0 | ||
| 91 | @@ -38,103 +38,7 @@ static size_t cachesize; | ||
| 92 | /* 1 if cache_data + PTR points into the cache. */ | ||
| 93 | #define _dl_cache_verify_ptr(ptr) (ptr < cache_data_size) | ||
| 94 | |||
| 95 | -#define SEARCH_CACHE(cache) \ | ||
| 96 | -/* We use binary search since the table is sorted in the cache file. \ | ||
| 97 | - The first matching entry in the table is returned. \ | ||
| 98 | - It is important to use the same algorithm as used while generating \ | ||
| 99 | - the cache file. */ \ | ||
| 100 | -do \ | ||
| 101 | - { \ | ||
| 102 | - left = 0; \ | ||
| 103 | - right = cache->nlibs - 1; \ | ||
| 104 | - \ | ||
| 105 | - while (left <= right) \ | ||
| 106 | - { \ | ||
| 107 | - __typeof__ (cache->libs[0].key) key; \ | ||
| 108 | - \ | ||
| 109 | - middle = (left + right) / 2; \ | ||
| 110 | - \ | ||
| 111 | - key = cache->libs[middle].key; \ | ||
| 112 | - \ | ||
| 113 | - /* Make sure string table indices are not bogus before using \ | ||
| 114 | - them. */ \ | ||
| 115 | - if (! _dl_cache_verify_ptr (key)) \ | ||
| 116 | - { \ | ||
| 117 | - cmpres = 1; \ | ||
| 118 | - break; \ | ||
| 119 | - } \ | ||
| 120 | - \ | ||
| 121 | - /* Actually compare the entry with the key. */ \ | ||
| 122 | - cmpres = _dl_cache_libcmp (name, cache_data + key); \ | ||
| 123 | - if (__builtin_expect (cmpres == 0, 0)) \ | ||
| 124 | - { \ | ||
| 125 | - /* Found it. LEFT now marks the last entry for which we \ | ||
| 126 | - know the name is correct. */ \ | ||
| 127 | - left = middle; \ | ||
| 128 | - \ | ||
| 129 | - /* There might be entries with this name before the one we \ | ||
| 130 | - found. So we have to find the beginning. */ \ | ||
| 131 | - while (middle > 0) \ | ||
| 132 | - { \ | ||
| 133 | - __typeof__ (cache->libs[0].key) key; \ | ||
| 134 | - \ | ||
| 135 | - key = cache->libs[middle - 1].key; \ | ||
| 136 | - /* Make sure string table indices are not bogus before \ | ||
| 137 | - using them. */ \ | ||
| 138 | - if (! _dl_cache_verify_ptr (key) \ | ||
| 139 | - /* Actually compare the entry. */ \ | ||
| 140 | - || _dl_cache_libcmp (name, cache_data + key) != 0) \ | ||
| 141 | - break; \ | ||
| 142 | - --middle; \ | ||
| 143 | - } \ | ||
| 144 | - \ | ||
| 145 | - do \ | ||
| 146 | - { \ | ||
| 147 | - int flags; \ | ||
| 148 | - __typeof__ (cache->libs[0]) *lib = &cache->libs[middle]; \ | ||
| 149 | - \ | ||
| 150 | - /* Only perform the name test if necessary. */ \ | ||
| 151 | - if (middle > left \ | ||
| 152 | - /* We haven't seen this string so far. Test whether the \ | ||
| 153 | - index is ok and whether the name matches. Otherwise \ | ||
| 154 | - we are done. */ \ | ||
| 155 | - && (! _dl_cache_verify_ptr (lib->key) \ | ||
| 156 | - || (_dl_cache_libcmp (name, cache_data + lib->key) \ | ||
| 157 | - != 0))) \ | ||
| 158 | - break; \ | ||
| 159 | - \ | ||
| 160 | - flags = lib->flags; \ | ||
| 161 | - if (_dl_cache_check_flags (flags) \ | ||
| 162 | - && _dl_cache_verify_ptr (lib->value)) \ | ||
| 163 | - { \ | ||
| 164 | - if (best == NULL || flags == GLRO(dl_correct_cache_id)) \ | ||
| 165 | - { \ | ||
| 166 | - HWCAP_CHECK; \ | ||
| 167 | - best = cache_data + lib->value; \ | ||
| 168 | - \ | ||
| 169 | - if (flags == GLRO(dl_correct_cache_id)) \ | ||
| 170 | - /* We've found an exact match for the shared \ | ||
| 171 | - object and no general `ELF' release. Stop \ | ||
| 172 | - searching. */ \ | ||
| 173 | - break; \ | ||
| 174 | - } \ | ||
| 175 | - } \ | ||
| 176 | - } \ | ||
| 177 | - while (++middle <= right); \ | ||
| 178 | - break; \ | ||
| 179 | - } \ | ||
| 180 | - \ | ||
| 181 | - if (cmpres < 0) \ | ||
| 182 | - left = middle + 1; \ | ||
| 183 | - else \ | ||
| 184 | - right = middle - 1; \ | ||
| 185 | - } \ | ||
| 186 | - } \ | ||
| 187 | -while (0) | ||
| 188 | - | ||
| 189 | - | ||
| 190 | int | ||
| 191 | -internal_function | ||
| 192 | _dl_cache_libcmp (const char *p1, const char *p2) | ||
| 193 | { | ||
| 194 | while (*p1 != '\0') | ||
| 195 | @@ -173,139 +77,4 @@ _dl_cache_libcmp (const char *p1, const | ||
| 196 | } | ||
| 197 | |||
| 198 | |||
| 199 | -/* Look up NAME in ld.so.cache and return the file name stored there, | ||
| 200 | - or null if none is found. */ | ||
| 201 | |||
| 202 | -const char * | ||
| 203 | -internal_function | ||
| 204 | -_dl_load_cache_lookup (const char *name) | ||
| 205 | -{ | ||
| 206 | - int left, right, middle; | ||
| 207 | - int cmpres; | ||
| 208 | - const char *cache_data; | ||
| 209 | - uint32_t cache_data_size; | ||
| 210 | - const char *best; | ||
| 211 | - | ||
| 212 | - /* Print a message if the loading of libs is traced. */ | ||
| 213 | - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0)) | ||
| 214 | - _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE); | ||
| 215 | - | ||
| 216 | - if (cache == NULL) | ||
| 217 | - { | ||
| 218 | - /* Read the contents of the file. */ | ||
| 219 | - void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize, | ||
| 220 | - PROT_READ); | ||
| 221 | - | ||
| 222 | - /* We can handle three different cache file formats here: | ||
| 223 | - - the old libc5/glibc2.0/2.1 format | ||
| 224 | - - the old format with the new format in it | ||
| 225 | - - only the new format | ||
| 226 | - The following checks if the cache contains any of these formats. */ | ||
| 227 | - if (file != MAP_FAILED && cachesize > sizeof *cache | ||
| 228 | - && memcmp (file, CACHEMAGIC, sizeof CACHEMAGIC - 1) == 0) | ||
| 229 | - { | ||
| 230 | - size_t offset; | ||
| 231 | - /* Looks ok. */ | ||
| 232 | - cache = file; | ||
| 233 | - | ||
| 234 | - /* Check for new version. */ | ||
| 235 | - offset = ALIGN_CACHE (sizeof (struct cache_file) | ||
| 236 | - + cache->nlibs * sizeof (struct file_entry)); | ||
| 237 | - | ||
| 238 | - cache_new = (struct cache_file_new *) ((void *) cache + offset); | ||
| 239 | - if (cachesize < (offset + sizeof (struct cache_file_new)) | ||
| 240 | - || memcmp (cache_new->magic, CACHEMAGIC_VERSION_NEW, | ||
| 241 | - sizeof CACHEMAGIC_VERSION_NEW - 1) != 0) | ||
| 242 | - cache_new = (void *) -1; | ||
| 243 | - } | ||
| 244 | - else if (file != MAP_FAILED && cachesize > sizeof *cache_new | ||
| 245 | - && memcmp (file, CACHEMAGIC_VERSION_NEW, | ||
| 246 | - sizeof CACHEMAGIC_VERSION_NEW - 1) == 0) | ||
| 247 | - { | ||
| 248 | - cache_new = file; | ||
| 249 | - cache = file; | ||
| 250 | - } | ||
| 251 | - else | ||
| 252 | - { | ||
| 253 | - if (file != MAP_FAILED) | ||
| 254 | - __munmap (file, cachesize); | ||
| 255 | - cache = (void *) -1; | ||
| 256 | - } | ||
| 257 | - | ||
| 258 | - assert (cache != NULL); | ||
| 259 | - } | ||
| 260 | - | ||
| 261 | - if (cache == (void *) -1) | ||
| 262 | - /* Previously looked for the cache file and didn't find it. */ | ||
| 263 | - return NULL; | ||
| 264 | - | ||
| 265 | - best = NULL; | ||
| 266 | - | ||
| 267 | - if (cache_new != (void *) -1) | ||
| 268 | - { | ||
| 269 | - uint64_t platform; | ||
| 270 | - | ||
| 271 | - /* This is where the strings start. */ | ||
| 272 | - cache_data = (const char *) cache_new; | ||
| 273 | - | ||
| 274 | - /* Now we can compute how large the string table is. */ | ||
| 275 | - cache_data_size = (const char *) cache + cachesize - cache_data; | ||
| 276 | - | ||
| 277 | - platform = _dl_string_platform (GLRO(dl_platform)); | ||
| 278 | - if (platform != (uint64_t) -1) | ||
| 279 | - platform = 1ULL << platform; | ||
| 280 | - | ||
| 281 | - /* Only accept hwcap if it's for the right platform. */ | ||
| 282 | -#ifdef USE_TLS | ||
| 283 | -# define _DL_HWCAP_TLS_MASK (1LL << 63) | ||
| 284 | -#else | ||
| 285 | -# define _DL_HWCAP_TLS_MASK 0 | ||
| 286 | -#endif | ||
| 287 | -#define HWCAP_CHECK \ | ||
| 288 | - if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion)) \ | ||
| 289 | - continue; \ | ||
| 290 | - if (_DL_PLATFORMS_COUNT \ | ||
| 291 | - && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \ | ||
| 292 | - && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \ | ||
| 293 | - continue; \ | ||
| 294 | - if (lib->hwcap \ | ||
| 295 | - & ~(GLRO(dl_hwcap) | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK)) \ | ||
| 296 | - continue | ||
| 297 | - SEARCH_CACHE (cache_new); | ||
| 298 | - } | ||
| 299 | - else | ||
| 300 | - { | ||
| 301 | - /* This is where the strings start. */ | ||
| 302 | - cache_data = (const char *) &cache->libs[cache->nlibs]; | ||
| 303 | - | ||
| 304 | - /* Now we can compute how large the string table is. */ | ||
| 305 | - cache_data_size = (const char *) cache + cachesize - cache_data; | ||
| 306 | - | ||
| 307 | -#undef HWCAP_CHECK | ||
| 308 | -#define HWCAP_CHECK do {} while (0) | ||
| 309 | - SEARCH_CACHE (cache); | ||
| 310 | - } | ||
| 311 | - | ||
| 312 | - /* Print our result if wanted. */ | ||
| 313 | - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0) | ||
| 314 | - && best != NULL) | ||
| 315 | - _dl_debug_printf (" trying file=%s\n", best); | ||
| 316 | - | ||
| 317 | - return best; | ||
| 318 | -} | ||
| 319 | - | ||
| 320 | -#ifndef MAP_COPY | ||
| 321 | -/* If the system does not support MAP_COPY we cannot leave the file open | ||
| 322 | - all the time since this would create problems when the file is replaced. | ||
| 323 | - Therefore we provide this function to close the file and open it again | ||
| 324 | - once needed. */ | ||
| 325 | -void | ||
| 326 | -_dl_unload_cache (void) | ||
| 327 | -{ | ||
| 328 | - if (cache != NULL && cache != (struct cache_file *) -1) | ||
| 329 | - { | ||
| 330 | - __munmap (cache, cachesize); | ||
| 331 | - cache = NULL; | ||
| 332 | - } | ||
| 333 | -} | ||
| 334 | -#endif | ||
| 335 | Index: 1/dl-cache.h | ||
| 336 | =================================================================== | ||
| 337 | --- 1.orig/dl-cache.h 2007-11-23 17:05:44.000000000 +0000 | ||
| 338 | +++ 1/dl-cache.h 2007-11-23 17:05:56.000000000 +0000 | ||
| 339 | @@ -101,5 +101,4 @@ struct cache_file_new | ||
| 340 | (((addr) + __alignof__ (struct cache_file_new) -1) \ | ||
| 341 | & (~(__alignof__ (struct cache_file_new) - 1))) | ||
| 342 | |||
| 343 | -extern int _dl_cache_libcmp (const char *p1, const char *p2) | ||
| 344 | - internal_function; | ||
| 345 | +extern int _dl_cache_libcmp (const char *p1, const char *p2); | ||
| 346 | Index: 1/ldconfig.c | ||
| 347 | =================================================================== | ||
| 348 | --- 1.orig/ldconfig.c 2007-11-23 17:05:44.000000000 +0000 | ||
| 349 | +++ 1/ldconfig.c 2007-11-23 17:05:56.000000000 +0000 | ||
| 350 | @@ -15,6 +15,9 @@ | ||
| 351 | along with this program; if not, write to the Free Software Foundation, | ||
| 352 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | ||
| 353 | |||
| 354 | +#define _LARGEFILE64_SOURCE | ||
| 355 | +#define _GNU_SOURCE | ||
| 356 | + | ||
| 357 | #define PROCINFO_CLASS static | ||
| 358 | #include <alloca.h> | ||
| 359 | #include <argp.h> | ||
| 360 | @@ -37,10 +40,20 @@ | ||
| 361 | #include <glob.h> | ||
| 362 | #include <libgen.h> | ||
| 363 | |||
| 364 | -#include <ldconfig.h> | ||
| 365 | -#include <dl-cache.h> | ||
| 366 | +#include "ldconfig.h" | ||
| 367 | +#include "dl-cache.h" | ||
| 368 | + | ||
| 369 | +#include "dl-procinfo.h" | ||
| 370 | + | ||
| 371 | +#include "argp.h" | ||
| 372 | + | ||
| 373 | + | ||
| 374 | +#define SYSCONFDIR "/etc" | ||
| 375 | +#define LIBDIR "/usr/lib" | ||
| 376 | +#define SLIBDIR "/lib" | ||
| 377 | +# define N_(msgid) msgid | ||
| 378 | +#define _(msg) msg | ||
| 379 | |||
| 380 | -#include <dl-procinfo.h> | ||
| 381 | |||
| 382 | #ifdef _DL_FIRST_PLATFORM | ||
| 383 | # define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT) | ||
| 384 | @@ -53,7 +66,7 @@ | ||
| 385 | #endif | ||
| 386 | |||
| 387 | /* Get libc version number. */ | ||
| 388 | -#include <version.h> | ||
| 389 | +#include "version.h" | ||
| 390 | |||
| 391 | #define PACKAGE _libc_intl_domainname | ||
| 392 | |||
| 393 | @@ -143,8 +156,8 @@ static const struct argp_option options[ | ||
| 394 | { NULL, 0, NULL, 0, NULL, 0 } | ||
| 395 | }; | ||
| 396 | |||
| 397 | -#define PROCINFO_CLASS static | ||
| 398 | -#include <dl-procinfo.c> | ||
| 399 | +//#define PROCINFO_CLASS static | ||
| 400 | +//#include <dl-procinfo.c> | ||
| 401 | |||
| 402 | /* Short description of program. */ | ||
| 403 | static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings."); | ||
| 404 | @@ -281,7 +294,7 @@ parse_opt (int key, char *arg, struct ar | ||
| 405 | static void | ||
| 406 | print_version (FILE *stream, struct argp_state *state) | ||
| 407 | { | ||
| 408 | - fprintf (stream, "ldconfig (GNU %s) %s\n", PACKAGE, VERSION); | ||
| 409 | + fprintf (stream, "ldconfig (Hacked Poky Version)\n"); | ||
| 410 | fprintf (stream, gettext ("\ | ||
| 411 | Copyright (C) %s Free Software Foundation, Inc.\n\ | ||
| 412 | This is free software; see the source for copying conditions. There is NO\n\ | ||
| 413 | Index: 1/readlib.c | ||
| 414 | =================================================================== | ||
| 415 | --- 1.orig/readlib.c 2007-11-23 17:05:44.000000000 +0000 | ||
| 416 | +++ 1/readlib.c 2007-11-23 17:05:56.000000000 +0000 | ||
| 417 | @@ -21,6 +21,9 @@ | ||
| 418 | development version. Besides the simplification, it has also been | ||
| 419 | modified to read some other file formats. */ | ||
| 420 | |||
| 421 | +#define _LARGEFILE64_SOURCE | ||
| 422 | +#define _GNU_SOURCE | ||
| 423 | + | ||
| 424 | #include <a.out.h> | ||
| 425 | #include <elf.h> | ||
| 426 | #include <error.h> | ||
| 427 | @@ -34,7 +37,9 @@ | ||
| 428 | #include <sys/stat.h> | ||
| 429 | #include <gnu/lib-names.h> | ||
| 430 | |||
| 431 | -#include <ldconfig.h> | ||
| 432 | +#include "ldconfig.h" | ||
| 433 | + | ||
| 434 | +#define _(msg) msg | ||
| 435 | |||
| 436 | #define Elf32_CLASS ELFCLASS32 | ||
| 437 | #define Elf64_CLASS ELFCLASS64 | ||
| 438 | Index: 1/xstrdup.c | ||
| 439 | =================================================================== | ||
| 440 | --- 1.orig/xstrdup.c 2007-11-23 17:05:44.000000000 +0000 | ||
| 441 | +++ 1/xstrdup.c 2007-11-23 17:05:56.000000000 +0000 | ||
| 442 | @@ -15,15 +15,10 @@ | ||
| 443 | along with this program; if not, write to the Free Software Foundation, | ||
| 444 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | ||
| 445 | |||
| 446 | -#ifdef HAVE_CONFIG_H | ||
| 447 | -# include <config.h> | ||
| 448 | -#endif | ||
| 449 | +#define _GNU_SOURCE | ||
| 450 | + | ||
| 451 | +#include <string.h> | ||
| 452 | |||
| 453 | -#if defined STDC_HEADERS || defined HAVE_STRING_H || _LIBC | ||
| 454 | -# include <string.h> | ||
| 455 | -#else | ||
| 456 | -# include <strings.h> | ||
| 457 | -#endif | ||
| 458 | void *xmalloc (size_t n) __THROW; | ||
| 459 | char *xstrdup (char *string) __THROW; | ||
| 460 | |||
diff --git a/meta/recipes-core/glibc/ldconfig-native_2.5.bb b/meta/recipes-core/glibc/ldconfig-native_2.5.bb deleted file mode 100644 index 39c8ce35e5..0000000000 --- a/meta/recipes-core/glibc/ldconfig-native_2.5.bb +++ /dev/null | |||
| @@ -1,24 +0,0 @@ | |||
| 1 | DESCRIPTION = "A standalone native ldconfig build" | ||
| 2 | |||
| 3 | LICENSE = "GPLv2" | ||
| 4 | |||
| 5 | LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=16;md5=8b3df71ec5b0feeeeab79025096aa92c" | ||
| 6 | |||
| 7 | SRC_URI = "file://ldconfig-native-2.5.tar.bz2 \ | ||
| 8 | file://ldconfig.patch;patch=1 \ | ||
| 9 | file://32and64bit.patch;patch=1" | ||
| 10 | |||
| 11 | PR = "r1" | ||
| 12 | |||
| 13 | inherit native | ||
| 14 | |||
| 15 | S = "${WORKDIR}/${PN}-${PV}" | ||
| 16 | |||
| 17 | do_compile () { | ||
| 18 | $CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c -I. dl-cache.c -o ldconfig | ||
| 19 | } | ||
| 20 | |||
| 21 | do_install () { | ||
| 22 | install -d ${D}/${bindir}/ | ||
| 23 | install ldconfig ${D}/${bindir}/ | ||
| 24 | } | ||
