+2005-04-11 David S. Miller <davem@davemloft.net>
+
+ * elf32-sparc.c (elf32_sparc_relocate_section,
+ R_SPARC_TLS_LDO_{HIX22,LOX10}): When not shared, transition to
+ R_SPARC_TLS_LE_{HIX22,LOX10}.
+ (elf32_sparc_relocate_section, R_SPARC_TLS_{LDO,LE}_HIX22): Only
+ xor relocation with 0xffffffff if R_SPARC_TLS_LE_HIX22.
+ (elf32_sparc_relocate_section, R_SPARC_TLS_{LDO,LE}_LOX10): Only
+ or 0x1c00 into relocation if R_SPARC_TLS_LE_HIX22.
+
2005-04-11 H.J. Lu <hongjiu.lu@intel.com>
* coffcode.h (STRING_SIZE_SIZE): Updated to match libcoff-in.h.
case R_SPARC_TLS_LDO_HIX22:
case R_SPARC_TLS_LDO_LOX10:
if (info->shared)
- relocation -= dtpoff_base (info);
- else
- relocation = tpoff (info, relocation);
- break;
+ {
+ relocation -= dtpoff_base (info);
+ break;
+ }
+
+ r_type = (r_type == R_SPARC_TLS_LDO_HIX22
+ ? R_SPARC_TLS_LE_HIX22 : R_SPARC_TLS_LE_LOX10);
+ /* Fall through. */
case R_SPARC_TLS_LE_HIX22:
case R_SPARC_TLS_LE_LOX10:
bfd_vma x;
relocation += rel->r_addend;
- relocation = relocation ^ 0xffffffff;
+ if (r_type == R_SPARC_TLS_LE_HIX22)
+ relocation = relocation ^ 0xffffffff;
x = bfd_get_32 (input_bfd, contents + rel->r_offset);
x = (x & ~(bfd_vma) 0x3fffff) | ((relocation >> 10) & 0x3fffff);
bfd_vma x;
relocation += rel->r_addend;
- relocation = (relocation & 0x3ff) | 0x1c00;
+ relocation &= 0x3ff;
+ if (r_type == R_SPARC_TLS_LE_LOX10)
+ relocation |= 0x1c00;
x = bfd_get_32 (input_bfd, contents + rel->r_offset);
x = (x & ~(bfd_vma) 0x1fff) | relocation;