aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-01-09 22:51:37 +0000
committerAlan Modra <amodra@gmail.com>2003-01-09 22:51:37 +0000
commit86bbe32fa7a502c07ecde03f51bb0441eff907b6 (patch)
tree233fc7deb0000af6e7003ed821a951c063fc6cb9 /bfd
parent2b0ee4544f77f96624edceaae5e51bbcc67e2640 (diff)
downloadgdb-86bbe32fa7a502c07ecde03f51bb0441eff907b6.zip
gdb-86bbe32fa7a502c07ecde03f51bb0441eff907b6.tar.gz
gdb-86bbe32fa7a502c07ecde03f51bb0441eff907b6.tar.bz2
* elf32-ppc.c (ppc_elf_relocate_section): Adjust addend for GOT16_HA.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise. PLTGOT16_HA too.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-ppc.c16
-rw-r--r--bfd/elf64-ppc.c4
3 files changed, 17 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 44f3ac3..6e02f61 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-10 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Adjust addend for GOT16_HA.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. PLTGOT16_HA too.
+
2002-01-08 Klee Dienes <kdienes@apple.com>
* Makefile.am (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c.
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 2406c67..c8aae88 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -1,5 +1,5 @@
/* PowerPC-specific support for 32-bit ELF
- Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
@@ -3414,6 +3414,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
relocation = sgot->output_offset + off - 4;
}
+ if (r_type == R_PPC_GOT16_HA)
+ addend += ((relocation + addend) & 0x8000) << 1;
break;
/* Indirect .sdata relocation */
@@ -3946,7 +3948,7 @@ ppc_elf_begin_write_processing (abfd, link_info)
unsigned long datum;
char * ptr;
-
+
asec = bfd_get_section_by_name (ibfd, APUINFO_SECTION_NAME);
if (asec == NULL)
continue;
@@ -3957,7 +3959,7 @@ ppc_elf_begin_write_processing (abfd, link_info)
error_message = _("corrupt or empty %s section in %s");
goto fail;
}
-
+
if (bfd_seek (ibfd, asec->filepos, SEEK_SET) != 0
|| (bfd_bread (buffer + offset, length, ibfd) != length))
{
@@ -4011,7 +4013,7 @@ ppc_elf_begin_write_processing (abfd, link_info)
if (! bfd_set_section_size (abfd, asec, output_section_size))
ibfd = abfd,
error_message = _("warning: unable to set size of %s section in %s");
-
+
fail:
free (buffer);
@@ -4071,7 +4073,7 @@ ppc_elf_final_write_processing (abfd, linker)
bfd_put_32 (abfd, num_entries, buffer + 4);
bfd_put_32 (abfd, 0x2, buffer + 8);
strcpy (buffer + 12, APUINFO_LABEL);
-
+
length = 20;
for (i = 0; i < num_entries; i++)
{
@@ -4081,10 +4083,10 @@ ppc_elf_final_write_processing (abfd, linker)
if (length != asec->_raw_size)
_bfd_error_handler (_("failed to compute new APUinfo section."));
-
+
if (! bfd_set_section_contents (abfd, asec, buffer, (file_ptr) 0, length))
_bfd_error_handler (_("failed to install new APUinfo section."));
-
+
free (buffer);
apuinfo_list_finish ();
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 5791883..f78f275 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -1,5 +1,5 @@
/* PowerPC64-specific support for 64-bit ELF.
- Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Linus Nordberg, Swox AB <info@swox.com>,
based on elf32-ppc.c by Ian Lance Taylor.
@@ -5903,6 +5903,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
case R_PPC64_ADDR16_HA:
case R_PPC64_ADDR16_HIGHERA:
case R_PPC64_ADDR16_HIGHESTA:
+ case R_PPC64_GOT16_HA:
+ case R_PPC64_PLTGOT16_HA:
case R_PPC64_PLT16_HA:
case R_PPC64_TOC16_HA:
case R_PPC64_SECTOFF_HA: