2005-05-05 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / bfd / coff-h8300.c
index 0dfbd8b0a8dce926f1ef70e5ec27cc2073a4adb7..1fb94f85a49604c515e4fa19c19cafacaedda273 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for Renesas H8/300 COFF binaries.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004
+   2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation, Inc.
    Written by Steve Chamberlain, <sac@cygnus.com>.
 
@@ -18,7 +18,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include "bfd.h"
 #include "sysdep.h"
@@ -1175,14 +1175,12 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
        name = symbol->name;
        if (symbol->flags & BSF_LOCAL)
          {
-           char *new_name = bfd_malloc ((bfd_size_type) strlen (name) + 9);
+           char *new_name = bfd_malloc ((bfd_size_type) strlen (name) + 10);
 
            if (new_name == NULL)
              abort ();
 
-           strcpy (new_name, name);
-           sprintf (new_name + strlen (name), "_%08x",
-                    (int) symbol->section);
+           sprintf (new_name, "%s_%08x", name, symbol->section->id);
            name = new_name;
          }
 
@@ -1365,13 +1363,11 @@ h8300_bfd_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
                {
                  char *new_name;
 
-                 new_name = bfd_malloc ((bfd_size_type) strlen (name) + 9);
+                 new_name = bfd_malloc ((bfd_size_type) strlen (name) + 10);
                  if (new_name == NULL)
                    abort ();
 
-                 strcpy (new_name, name);
-                 sprintf (new_name + strlen (name), "_%08x",
-                          (int) symbol->section);
+                 sprintf (new_name, "%s_%08x", name, symbol->section->id);
                  name = new_name;
                }
 
This page took 0.024115 seconds and 4 git commands to generate.