Files
MSYS2-packages/binutils/02-x86-64-pc32-relocs.patch
2013-11-03 19:01:32 +04:00

52 lines
1.5 KiB
Diff

Index: bfd/cofflink.c
===================================================================
RCS file: /cvs/src/src/bfd/cofflink.c,v
retrieving revision 1.84
diff -c -p -r1.84 cofflink.c
*** bfd/cofflink.c 10 Jan 2013 20:03:52 -0000 1.84
--- bfd/cofflink.c 4 Jun 2013 12:03:23 -0000
*************** _bfd_coff_generic_relocate_section (bfd
*** 3060,3065 ****
--- 3060,3070 ----
else
{
sec = sections[symndx];
+
+ /* If the output section has been discarded then ignore this reloc. */
+ if (sec->output_section->vma == 0)
+ continue;
+
val = (sec->output_section->vma
+ sec->output_offset
+ sym->n_value);
*************** _bfd_coff_generic_relocate_section (bfd
*** 3080,3086 ****
+ sec->output_section->vma
+ sec->output_offset);
}
-
else if (h->root.type == bfd_link_hash_undefweak)
{
if (h->symbol_class == C_NT_WEAK && h->numaux == 1)
--- 3085,3090 ----
*************** _bfd_coff_generic_relocate_section (bfd
*** 3116,3122 ****
/* This is a GNU extension. */
val = 0;
}
-
else if (! info->relocatable)
{
if (! ((*info->callbacks->undefined_symbol)
--- 3120,3125 ----
*************** _bfd_coff_generic_relocate_section (bfd
*** 3183,3189 ****
if (name == NULL)
return FALSE;
}
-
if (! ((*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section,
--- 3186,3191 ----