[yocto] [prelink-cross] Support x32 libx32 directory
Joseph Myers
joseph at codesourcery.com
Wed Sep 14 16:23:13 PDT 2016
Cross-prelink's prelink-rtld is missing suport for the /libx32
directory used with the x86_64 x32 ABI. This patch adds such support.
2016-09-14 Joseph Myers <joseph at codesourcery.com>
* src/rtld/rtld.c (load_ld_so_conf): Add argument use_x32.
(main): Update call to load_ld_so_conf.
diff --git a/src/rtld/rtld.c b/src/rtld/rtld.c
index 8d7d760..2d72083 100644
--- a/src/rtld/rtld.c
+++ b/src/rtld/rtld.c
@@ -409,7 +409,7 @@ free_path (struct search_path *path)
}
void
-load_ld_so_conf (int use_64bit, int use_mipsn32)
+load_ld_so_conf (int use_64bit, int use_mipsn32, int use_x32)
{
int fd;
FILE *conf;
@@ -435,6 +435,14 @@ load_ld_so_conf (int use_64bit, int use_mipsn32)
add_dir (&ld_dirs, "/usr/lib32/tls", strlen ("/usr/lib32/tls"));
add_dir (&ld_dirs, "/usr/lib32", strlen ("/usr/lib32"));
}
+ else if (use_x32)
+ {
+ dst_LIB = "libx32";
+ add_dir (&ld_dirs, "/libx32/tls", strlen ("/libx32/tls"));
+ add_dir (&ld_dirs, "/libx32", strlen ("/libx32"));
+ add_dir (&ld_dirs, "/usr/libx32/tls", strlen ("/usr/libx32/tls"));
+ add_dir (&ld_dirs, "/usr/libx32", strlen ("/usr/libx32"));
+ }
else
{
dst_LIB = "lib";
@@ -1195,7 +1203,8 @@ main(int argc, char **argv)
}
load_ld_so_conf (gelf_getclass (dso->elf) == ELFCLASS64,
- ( dso->ehdr.e_machine == EM_MIPS) && ( dso->ehdr.e_flags & EF_MIPS_ABI2 ) );
+ ( dso->ehdr.e_machine == EM_MIPS) && ( dso->ehdr.e_flags & EF_MIPS_ABI2 ),
+ dso->ehdr.e_machine == EM_X86_64 && gelf_getclass (dso->elf) == ELFCLASS32);
if (multiple)
printf ("%s:\n", argv[remaining]);
--
Joseph S. Myers
joseph at codesourcery.com
More information about the yocto
mailing list