summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/bfd/coff-ppc.c
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-12-09 17:57:18 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2014-12-09 19:50:14 +0800
commit5e8c1cf25beccac1d22d10dc866912394f42771b (patch)
treeee16b70f804484dc8e434e647e699ab50da2620f /binutils-2.25/bfd/coff-ppc.c
parent8eebd7953384e6662ca926b003f2cdda8ccd3ee5 (diff)
downloadtoolchain_binutils-5e8c1cf25beccac1d22d10dc866912394f42771b.tar.gz
toolchain_binutils-5e8c1cf25beccac1d22d10dc866912394f42771b.tar.bz2
toolchain_binutils-5e8c1cf25beccac1d22d10dc866912394f42771b.zip
[2.25] sync to a30720e3e633f275250e26f85ccae5dbdddfb6c6
local patches will be re-applied later commit a30720e3e633f275250e26f85ccae5dbdddfb6c6 Author: Alan Modra <amodra@gmail.com> Date: Wed Nov 19 10:30:16 2014 +1030 daily update Change-Id: Ieb2a3f4dd2ecb289ac5305ff08d428b2847494ab
Diffstat (limited to 'binutils-2.25/bfd/coff-ppc.c')
-rw-r--r--binutils-2.25/bfd/coff-ppc.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/binutils-2.25/bfd/coff-ppc.c b/binutils-2.25/bfd/coff-ppc.c
index eb1aa81a..32d30120 100644
--- a/binutils-2.25/bfd/coff-ppc.c
+++ b/binutils-2.25/bfd/coff-ppc.c
@@ -1,7 +1,5 @@
/* BFD back-end for PowerPC Microsoft Portable Executable files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
- 2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2014 Free Software Foundation, Inc.
Original version pieced together by Kim Knuttila (krk@cygnus.com)
@@ -1075,10 +1073,11 @@ coff_ppc_relocate_section (bfd *output_bfd,
{
/* It is a file local symbol. */
int *local_toc_table;
- const char *name;
+ char name[SYMNMLEN + 1];
sym = syms + symndx;
- name = sym->_n._n_name;
+ strncpy (name, sym->_n._n_name, SYMNMLEN);
+ name[SYMNMLEN] = '\0';
local_toc_table = obj_coff_local_toc_table(input_bfd);
our_toc_offset = local_toc_table[symndx];
@@ -1227,9 +1226,14 @@ coff_ppc_relocate_section (bfd *output_bfd,
case IMAGE_REL_PPC_ABSOLUTE:
{
const char *my_name;
+ char buf[SYMNMLEN + 1];
if (h == 0)
- my_name = (syms+symndx)->_n._n_name;
+ {
+ strncpy (buf, (syms+symndx)->_n._n_name, SYMNMLEN);
+ buf[SYMNMLEN] = '\0';
+ my_name = buf;
+ }
else
my_name = h->root.root.root.string;
@@ -1290,11 +1294,8 @@ coff_ppc_relocate_section (bfd *output_bfd,
}
if (h == 0)
- {
- /* It is a file local symbol. */
- sym = syms + symndx;
- name = sym->_n._n_name;
- }
+ /* It is a file local symbol. */
+ sym = syms + symndx;
else
{
char *target = 0;
@@ -2151,7 +2152,7 @@ ppc_bfd_coff_final_link (bfd *abfd, struct bfd_link_info *info)
the opportunity to clear the output_has_begun fields of all the
input BFD's. */
max_sym_count = 0;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
bfd_size_type sz;