diff options
-rw-r--r-- | trunk/ChangeLog.cross | 7 | ||||
-rw-r--r-- | trunk/src/arch-mips.c | 16 |
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: |