aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2010-06-15 14:17:04 -0500
committerMark Hatle <mark.hatle@windriver.com>2010-07-22 18:47:09 -0500
commit1c973105e4bad9e31f0096fd6baa41e772d17484 (patch)
treeb646c756c79fe08b49eef65f411c3b35e8ab1e30
parent3e1b95b7a22be319dea33b0683a93486971d558a (diff)
downloadprelink-cross-1c973105e4bad9e31f0096fd6baa41e772d17484.tar.gz
prelink-cross-1c973105e4bad9e31f0096fd6baa41e772d17484.tar.bz2
prelink-cross-1c973105e4bad9e31f0096fd6baa41e772d17484.zip
Resolve R_MIPS_TLS_DTPMOD32/64 relocationscross_prelink_r174
2009-09-01 Maciej W. Rozycki <macro@codesourcery.com> Issue #5273 * src/arch-mips.c (mips_prelink_reloc): Resolve R_MIPS_TLS_DTPMOD32 and R_MIPS_TLS_DTPMOD64 relocations in executables.
-rw-r--r--trunk/ChangeLog.cross7
-rw-r--r--trunk/src/arch-mips.c16
2 files changed, 21 insertions, 2 deletions
diff --git a/trunk/ChangeLog.cross b/trunk/ChangeLog.cross
index 33f9a85..6a4acf6 100644
--- a/trunk/ChangeLog.cross
+++ b/trunk/ChangeLog.cross
@@ -1,3 +1,10 @@
+2009-09-01 Maciej W. Rozycki <macro@codesourcery.com>
+
+ Issue #5273
+ * src/arch-mips.c (mips_prelink_reloc): Resolve
+ R_MIPS_TLS_DTPMOD32 and R_MIPS_TLS_DTPMOD64 relocations in
+ executables.
+
2009-04-27 Maciej W. Rozycki <macro@codesourcery.com>
Issue #5165
* src/ld-libs.c (load_ld_so_conf): Fix a buffer overrun. Don't
diff --git a/trunk/src/arch-mips.c b/trunk/src/arch-mips.c
index 3825da3..25fdacc 100644
--- a/trunk/src/arch-mips.c
+++ b/trunk/src/arch-mips.c
@@ -535,8 +535,20 @@ mips_prelink_reloc (struct prelink_info *info, GElf_Addr r_offset,
case R_MIPS_TLS_DTPMOD32:
case R_MIPS_TLS_DTPMOD64:
- /* These relocations will be resolved using a conflict. We need
- not change the field value here. */
+ /* Relocations in a shared library will be resolved using a conflict.
+ We need not change the relocation field here. */
+ if (dso->ehdr.e_type == ET_EXEC)
+ {
+ struct prelink_tls *tls = info->symbols[r_sym].u.tls;
+
+ if (tls == NULL)
+ break;
+ value = tls->modid;
+ if (r_type == R_MIPS_TLS_DTPMOD32)
+ mips_prelink_32bit_reloc (dso, rela, value);
+ else
+ mips_prelink_64bit_reloc (dso, rela, value);
+ }
break;
case R_MIPS_TLS_DTPREL32: