aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2010-06-14 18:40:08 -0500
committerMark Hatle <mark.hatle@windriver.com>2010-07-22 18:20:00 -0500
commit6a13bb4c4df937853f93bab0d427a01a256591b8 (patch)
tree26fef947e9ae890d42df7e5bc492a9fd4c673682
parent6523cb68a127ab61f0025fecdceafb50eaeb4d7f (diff)
downloadprelink-cross-6a13bb4c4df937853f93bab0d427a01a256591b8.tar.gz
prelink-cross-6a13bb4c4df937853f93bab0d427a01a256591b8.tar.bz2
prelink-cross-6a13bb4c4df937853f93bab0d427a01a256591b8.zip
Add sparc64 fixes
2008-09-18 Joseph Myers <joseph@codesourcery.com> * src/ld-libs.c (reloc_type_class, determine_tlsoffsets): Handle SPARC. * src/arch-sparc64.c (sparc64_prelink_rela, sparc64_prelink_conflict_rela, sparc64_undo_prelink_rela, sparc64_reloc_class): Handle TLS relocations. (PL_ARCH(sparc64)): Update mmap_base and mmap_end for TASK_UNMAPPED_BASE change to 0xfffff80100000000.
-rw-r--r--trunk/ChangeLog.cross10
-rw-r--r--trunk/src/ld-libs.c49
2 files changed, 56 insertions, 3 deletions
diff --git a/trunk/ChangeLog.cross b/trunk/ChangeLog.cross
index c8b30be..8ce06ce 100644
--- a/trunk/ChangeLog.cross
+++ b/trunk/ChangeLog.cross
@@ -2,6 +2,16 @@
* Integrate prelinker/cross-prelinking patches
+ 2008-09-18 Joseph Myers <joseph@codesourcery.com>
+
+ * src/ld-libs.c (reloc_type_class, determine_tlsoffsets): Handle
+ SPARC.
+ * src/arch-sparc64.c (sparc64_prelink_rela,
+ sparc64_prelink_conflict_rela, sparc64_undo_prelink_rela,
+ sparc64_reloc_class): Handle TLS relocations.
+ (PL_ARCH(sparc64)): Update mmap_base and mmap_end for
+ TASK_UNMAPPED_BASE change to 0xfffff80100000000.
+
2008-10-02 Maciej W. Rozycki <macro@codesourcery.com>
* src/arch-mips.c (mips_prelink_reloc): Do not complain about
diff --git a/trunk/src/ld-libs.c b/trunk/src/ld-libs.c
index 3954cca..bd2a96e 100644
--- a/trunk/src/ld-libs.c
+++ b/trunk/src/ld-libs.c
@@ -177,15 +177,49 @@ reloc_type_class (int type, int machine)
switch (type)
{
case R_MIPS_COPY:
- return ELF_RTYPE_CLASS_COPY;
+ return ELF_RTYPE_CLASS_COPY;
case R_MIPS_JUMP_SLOT:
case R_MIPS_TLS_DTPMOD32:
case R_MIPS_TLS_DTPREL32:
case R_MIPS_TLS_TPREL32:
- return ELF_RTYPE_CLASS_PLT;
+ return ELF_RTYPE_CLASS_PLT;
+ default:
+ return 0;
+ }
+
+ case EM_SPARC:
+ case EM_SPARC32PLUS:
+ switch (type)
+ {
+ case R_SPARC_COPY:
+ return ELF_RTYPE_CLASS_COPY;
+ case R_SPARC_JMP_SLOT:
+ case R_SPARC_TLS_DTPMOD32:
+ case R_SPARC_TLS_DTPOFF32:
+ case R_SPARC_TLS_TPOFF32:
+ case R_SPARC_TLS_LE_HIX22:
+ case R_SPARC_TLS_LE_LOX10:
+ return ELF_RTYPE_CLASS_PLT;
default:
- return 0;
+ return 0;
}
+
+ case EM_SPARCV9:
+ switch (type)
+ {
+ case R_SPARC_COPY:
+ return ELF_RTYPE_CLASS_COPY;
+ case R_SPARC_JMP_SLOT:
+ case R_SPARC_TLS_DTPMOD64:
+ case R_SPARC_TLS_DTPOFF64:
+ case R_SPARC_TLS_TPOFF64:
+ case R_SPARC_TLS_LE_HIX22:
+ case R_SPARC_TLS_LE_LOX10:
+ return ELF_RTYPE_CLASS_PLT;
+ default:
+ return 0;
+ }
+
default:
printf ("Unknown architecture!\n");
exit (1);
@@ -1124,6 +1158,15 @@ determine_tlsoffsets (int e_machine, struct r_scope_elem *search_list)
offset = 0;
break;
+ case EM_SPARC:
+ case EM_SPARC32PLUS:
+ offset = -1;
+ break;
+
+ case EM_SPARCV9:
+ offset = -1;
+ break;
+
default:
/* Hope there's no TLS! */
for (i = 0; i < search_list->r_nlist; i++)