aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2007-08-08 17:58:05 -0500
committerMark Hatle <mark.hatle@windriver.com>2010-07-22 17:43:32 -0500
commit04e51c9c33b0784fd63f326b87d048545fb627e7 (patch)
treee1151115f328384ef4cc636ba2837ca4e1ebe66a
parent628eed313ea94698dc48fa981846a5e325d94199 (diff)
downloadprelink-cross-04e51c9c33b0784fd63f326b87d048545fb627e7.tar.gz
prelink-cross-04e51c9c33b0784fd63f326b87d048545fb627e7.tar.bz2
prelink-cross-04e51c9c33b0784fd63f326b87d048545fb627e7.zip
Import from: prelink-mips-n32.patch
* src/arch-mips.c: add /lib32/ld.so.1 as an alternative 32-bit linker * src/ld-libs.c: add a check for MIPS n32, and adjust ld_dirs as necessary
-rw-r--r--trunk/ChangeLog.cross6
-rw-r--r--trunk/src/arch-mips.c1
-rw-r--r--trunk/src/ld-libs.c12
3 files changed, 17 insertions, 2 deletions
diff --git a/trunk/ChangeLog.cross b/trunk/ChangeLog.cross
index 8201d0d..2257aa7 100644
--- a/trunk/ChangeLog.cross
+++ b/trunk/ChangeLog.cross
@@ -1,3 +1,9 @@
+2007-08-08 Mark Hatle <mark.hatle@windriver.com>
+
+ * src/arch-mips.c: add /lib32/ld.so.1 as an alternative 32-bit linker
+ * src/ld-libs.c: add a check for MIPS n32, and adjust ld_dirs as
+ necessary
+
2007-10-11 Richard Sandiford <richard@codesourcery.com>
* src/space.c (find_readonly_space): If a new PT_LOAD header is needed,
diff --git a/trunk/src/arch-mips.c b/trunk/src/arch-mips.c
index f5a2361..a57b6c8 100644
--- a/trunk/src/arch-mips.c
+++ b/trunk/src/arch-mips.c
@@ -992,6 +992,7 @@ PL_ARCH = {
.machine = EM_MIPS,
.max_reloc_size = 4,
.dynamic_linker = "/lib/ld.so.1",
+ .dynamic_linker_alt = "/lib32/ld.so.1",
/* MIPS does not use COPY relocs or jump slots. Pick a value outside
the ELF32_R_TYPE range. */
.R_COPY = ~0U,
diff --git a/trunk/src/ld-libs.c b/trunk/src/ld-libs.c
index d14b7b7..f36eee1 100644
--- a/trunk/src/ld-libs.c
+++ b/trunk/src/ld-libs.c
@@ -302,7 +302,7 @@ free_path (struct search_path *path)
}
void
-load_ld_so_conf (int use_64bit)
+load_ld_so_conf (int use_64bit, int use_mipsn32)
{
int fd;
FILE *conf;
@@ -319,6 +319,13 @@ load_ld_so_conf (int use_64bit)
add_dir (&ld_dirs, "/usr/lib64/tls", strlen ("/usr/lib64/tls"));
add_dir (&ld_dirs, "/usr/lib64", strlen ("/usr/lib64"));
}
+ else if (use_mipsn32)
+ {
+ add_dir (&ld_dirs, "/lib32/tls", strlen ("/lib32/tls"));
+ add_dir (&ld_dirs, "/lib32", strlen ("/lib32"));
+ add_dir (&ld_dirs, "/usr/lib32/tls", strlen ("/usr/lib32/tls"));
+ add_dir (&ld_dirs, "/usr/lib32", strlen ("/usr/lib32"));
+ }
else
{
add_dir (&ld_dirs, "/lib/tls", strlen ("/lib/tls"));
@@ -1235,7 +1242,8 @@ main(int argc, char **argv)
if (dso == NULL)
error (1, errno, "Could not open %s", argv[remaining]);
- load_ld_so_conf (gelf_getclass (dso->elf) == ELFCLASS64);
+ load_ld_so_conf (gelf_getclass (dso->elf) == ELFCLASS64,
+ ( dso->ehdr.e_machine == EM_MIPS) && ( dso->ehdr.e_flags & EF_MIPS_ABI2 ) );
if (multiple)
printf ("%s:\n", argv[remaining]);