This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[alpha] fix gprel32 references to discarded linkonce sections
- From: Richard Henderson <rth at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 9 Apr 2003 13:07:19 -0700
- Subject: [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)
{