* coff-h8300.c (h8300_reloc16_extra_cases): Use input section

"output_offset" instead of link order "offset".
	* coff-h8500.c (extra_case): Likewise.
	* coff-w65.c (w65_reloc16_extra_cases): Likewise.
	* coff-z80.c (extra_case): Likewise.
	* coff-z8k.c (extra_case): Likewise.
	* linker.c (default_indirect_link_order): Likewise, "size" too.
	* ecoff.c (ecoff_indirect_link_order): Likewise.
This commit is contained in:
Alan Modra 2005-12-27 03:06:27 +00:00
parent 2dadb5f9cc
commit 44da2da10b
8 changed files with 47 additions and 38 deletions

View File

@ -1,3 +1,14 @@
2005-12-27 Alan Modra <amodra@bigpond.net.au>
* coff-h8300.c (h8300_reloc16_extra_cases): Use input section
"output_offset" instead of link order "offset".
* coff-h8500.c (extra_case): Likewise.
* coff-w65.c (w65_reloc16_extra_cases): Likewise.
* coff-z80.c (extra_case): Likewise.
* coff-z8k.c (extra_case): Likewise.
* linker.c (default_indirect_link_order): Likewise, "size" too.
* ecoff.c (ecoff_indirect_link_order): Likewise.
2005-12-27 Alan Modra <amodra@bigpond.net.au>
* Makefile.am: Run "make dep-am".

View File

@ -671,7 +671,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* Get the address of the target of this branch. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
dot = (link_order->offset
dot = (input_section->output_offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma);
@ -703,7 +703,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
/* Get the address of the instruction (not the reloc). */
dot = (link_order->offset
dot = (input_section->output_offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma + 1);
@ -817,7 +817,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
/* Get the address of the next instruction. */
dot = (link_order->offset
dot = (input_section->output_offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma + 1);
@ -864,7 +864,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
/* Get the address of the instruction (not the reloc). */
dot = (link_order->offset
dot = (input_section->output_offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma - 1);
@ -925,7 +925,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
/* Get the address of the instruction (not the reloc). */
dot = (link_order->offset
dot = (input_section->output_offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma + 2);
@ -1064,7 +1064,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
/* Get the address of the target of this branch. */
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
dot = (link_order->offset
dot = (input_section->output_offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma) + 1;

View File

@ -1,5 +1,5 @@
/* BFD back-end for Renesas H8/500 COFF binaries.
Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004
Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
@ -245,9 +245,9 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = link_order->offset
+ *dst_ptr
+ link_order->u.indirect.section->output_section->vma;
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1 since were in the odd byte of the
word and the pc's been incremented. */
@ -269,9 +269,9 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = link_order->offset
+ *dst_ptr
+ link_order->u.indirect.section->output_section->vma;
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1 since were in the odd byte of the
word and the pc's been incremented. */

View File

@ -1,5 +1,5 @@
/* BFD back-end for WDC 65816 COFF binaries.
Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004
Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
@ -316,9 +316,9 @@ w65_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
{
int gap = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = link_order->offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma;
bfd_vma dot = (dst_address
+ input_section->output_offset
+ input_section->output_section->vma);
gap -= dot + 1;
if (gap < -128 || gap > 127)
@ -340,9 +340,9 @@ w65_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
{
bfd_vma gap = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = link_order->offset
+ dst_address
+ link_order->u.indirect.section->output_section->vma;
bfd_vma dot = (dst_address
+ input_section->output_offset
+ input_section->output_section->vma);
/* This wraps within the page, so ignore the relativeness, look at the
high part. */

View File

@ -200,8 +200,8 @@ extra_case (bfd *in_abfd,
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1, Since the offset is relative
to the value of PC after reading

View File

@ -230,8 +230,8 @@ extra_case (bfd *in_abfd,
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1, since we're in the odd byte of the
word and the pc's been incremented. */
@ -258,8 +258,8 @@ extra_case (bfd *in_abfd,
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1, since we're in the odd byte of the
word and the pc's been incremented. */
@ -289,8 +289,8 @@ extra_case (bfd *in_abfd,
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 2;
@ -318,8 +318,8 @@ extra_case (bfd *in_abfd,
{
bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
input_section);
bfd_vma dot = (link_order->offset
+ *dst_ptr
bfd_vma dot = (*dst_ptr
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 2;

View File

@ -4002,11 +4002,10 @@ ecoff_indirect_link_order (bfd *output_bfd,
BFD_ASSERT ((output_section->flags & SEC_HAS_CONTENTS) != 0);
if (link_order->size == 0)
return TRUE;
input_section = link_order->u.indirect.section;
input_bfd = input_section->owner;
if (input_section->size == 0)
return TRUE;
BFD_ASSERT (input_section->output_section == output_section);
BFD_ASSERT (input_section->output_offset == link_order->offset);

View File

@ -2717,11 +2717,10 @@ default_indirect_link_order (bfd *output_bfd,
BFD_ASSERT ((output_section->flags & SEC_HAS_CONTENTS) != 0);
if (link_order->size == 0)
return TRUE;
input_section = link_order->u.indirect.section;
input_bfd = input_section->owner;
if (input_section->size == 0)
return TRUE;
BFD_ASSERT (input_section->output_section == output_section);
BFD_ASSERT (input_section->output_offset == link_order->offset);
@ -2810,9 +2809,9 @@ default_indirect_link_order (bfd *output_bfd,
goto error_return;
/* Output the section contents. */
loc = link_order->offset * bfd_octets_per_byte (output_bfd);
loc = input_section->output_offset * bfd_octets_per_byte (output_bfd);
if (! bfd_set_section_contents (output_bfd, output_section,
new_contents, loc, link_order->size))
new_contents, loc, input_section->size))
goto error_return;
if (contents != NULL)