This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[SH] Allow R_SH_TLS_LE_32 for PIE


Hi,

The attached patch for SH backend is very similar to the recent
patches for ARM and alpha.  Tested on sh4-unknown-linux-gnu and
applied on head.

Regards,
	kaz
--
2011-06-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* elf32-sh.c (sh_elf_relocate_section): Allow R_SH_TLS_LE_32 for PIE.
	(sh_elf_check_relocs): Likewise.

--- ORIG/bfd/elf32-sh.c	2011-02-04 19:11:21.000000000 +0900
+++ bfd/elf32-sh.c	2011-06-18 09:43:53.000000000 +0900
@@ -5525,7 +5525,7 @@ sh_elf_relocate_section (bfd *output_bfd
 
 	    check_segment[0] = check_segment[1] = -1;
 
-	    if (! info->shared)
+	    if (! info->shared || info->pie)
 	      {
 		relocation = tpoff (info, relocation);
 		addend = rel->r_addend;
@@ -6623,7 +6623,7 @@ sh_elf_check_relocs (bfd *abfd, struct b
 	  break;
 
 	case R_SH_TLS_LE_32:
-	  if (info->shared)
+	  if (info->shared && !info->pie)
 	    {
 	      (*_bfd_error_handler)
 		(_("%B: TLS local exec code cannot be linked into shared objects"),


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]