This is the mail archive of the binutils@sources.redhat.com 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]

[alpha] fix gprel32 references to discarded linkonce sections


As seen in gcc pr target/10326.


r~


	* elf64-alpha.c (elf64_alpha_relocate_section) <R_ALPHA_GPREL32>:
	Ignore relocations against r_symndx == 0.

Index: elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.94
diff -c -p -d -r1.94 elf64-alpha.c
*** elf64-alpha.c	17 Feb 2003 18:24:39 -0000	1.94
--- elf64-alpha.c	9 Apr 2003 20:02:12 -0000
*************** elf64_alpha_relocate_section (output_bfd
*** 4580,4587 ****
  	  value -= gp;
  	  goto default_reloc;
  
- 	case R_ALPHA_GPREL16:
  	case R_ALPHA_GPREL32:
  	case R_ALPHA_GPRELLOW:
  	  if (dynamic_symbol_p)
              {
--- 4580,4599 ----
  	  value -= gp;
  	  goto default_reloc;
  
  	case R_ALPHA_GPREL32:
+ 	  /* If the target section was a removed linkonce section,
+ 	     r_symndx will be zero.  In this case, assume that the
+ 	     switch will not be used, so don't fill it in.  If we
+ 	     do nothing here, we'll get relocation truncated messages,
+ 	     due to the placement of the application above 4GB.  */
+ 	  if (r_symndx == 0)
+ 	    {
+ 	      r = bfd_reloc_ok;
+ 	      break;
+ 	    }
+ 	  /* FALLTHRU */
+ 
+ 	case R_ALPHA_GPREL16:
  	case R_ALPHA_GPRELLOW:
  	  if (dynamic_symbol_p)
              {


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