packages: crossavr-binutils/crossavr-binutils-avr-coff.patch, crossavr-binu...

kosmo kosmo at pld-linux.org
Thu Oct 7 19:21:20 CEST 2010


Author: kosmo                        Date: Thu Oct  7 17:21:20 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- updated to 2.20.1
- patches synchronized with FreeBSD ports (includes recent changes from WinAVR project)

---- Files affected:
packages/crossavr-binutils:
   crossavr-binutils-avr-coff.patch (1.1 -> 1.2) , crossavr-binutils-new-sections.patch (1.1 -> 1.2) , crossavr-binutils-xmega.patch (1.1 -> 1.2) , crossavr-binutils.spec (1.34 -> 1.35) , crossavr-binutils-new-devices.patch (NONE -> 1.1)  (NEW), crossavr-binutils-xmega2.patch (1.1 -> NONE)  (REMOVED), crossavr-binutils-data-origin.patch (1.1 -> NONE)  (REMOVED), crossavr-binutils-atmega32u6.patch (1.1 -> NONE)  (REMOVED), crossavr-binutils-gcc44.patch (1.1 -> NONE)  (REMOVED)

---- Diffs:

================================================================
Index: packages/crossavr-binutils/crossavr-binutils-avr-coff.patch
diff -u packages/crossavr-binutils/crossavr-binutils-avr-coff.patch:1.1 packages/crossavr-binutils/crossavr-binutils-avr-coff.patch:1.2
--- packages/crossavr-binutils/crossavr-binutils-avr-coff.patch:1.1	Sun Apr  5 13:48:27 2009
+++ packages/crossavr-binutils/crossavr-binutils-avr-coff.patch	Thu Oct  7 19:21:14 2010
@@ -1,5463 +1,5385 @@
-AVR specific only
-Deprecated
---------------------------------------------------------------------------------
-diff -Nur ../binutils-2.18.orig/binutils/doc/objcopy.1 ./binutils/doc/objcopy.1
---- ../binutils-2.18.orig/binutils/doc/objcopy.1	Tue Oct 23 21:44:42 2007
-+++ ./binutils/doc/objcopy.1	Tue Oct 23 22:18:44 2007
-@@ -193,6 +193,8 @@
-         [\fB\-\-readonly\-text\fR]
-         [\fB\-\-pure\fR]
-         [\fB\-\-impure\fR]
-+        [\fB\-\-change\-pathname\fR \fIold\fR=\fInew\fR]
-+        [\fB\-\-basename\fR]
-         [\fB\-v\fR|\fB\-\-verbose\fR]
-         [\fB\-V\fR|\fB\-\-version\fR]  
-         [\fB\-\-help\fR] [\fB\-\-info\fR]
-@@ -807,6 +809,23 @@
- It can also be a useful way of reducing the size of a \fB\-\-just\-symbols\fR
- linker input file.
- .RE
-+.IP "\fB\-\-change\-pathname\fR \fIold\fR=\fInew\fR" 4
-+.IX Item "--change-pathname old=new"
-+When converting debugging information using \fB\-\-debugging\fR, for
-+every pathname that starts with \fIold\fR, replace the matching part
-+by \fInew\fR.  This is intented to map pathnames between different
-+debugging tools, or when parts of the object file(s) had their
-+pathnames recorded in a different build environment.  Note that only
-+leading directory name components might be changed that way, since the
-+trailing filename could be recorded elsewhere as well (depending on the
-+debugging format of the input file).
-+.IP "\fB\-\-basename\fR"
-+.IX Item "--basename"
-+When converting debugging information using \fB\-\-debugging\fR, for
-+every pathname, strip all leading directory information.  This option
-+takes precedence over any \fB\-\-change\-pathname\fR option.  For some
-+debugging formats that cannot handle long filenames, this options is
-+implied (notably, some COFF debugging formats).
- .IP "\fB\-V\fR" 4
- .IX Item "-V"
- .PD 0
-diff -Nur ../binutils-2.18.orig/binutils/Makefile.am ./binutils/Makefile.am
---- ../binutils-2.18.orig/binutils/Makefile.am	Tue Oct 23 21:44:42 2007
-+++ ./binutils/Makefile.am	Tue Oct 23 22:22:40 2007
-@@ -98,7 +98,7 @@
- 	resbin.c rescoff.c resrc.c resres.c \
- 	size.c srconv.c stabs.c strings.c sysdump.c \
- 	unwind-ia64.c version.c \
--	windres.c winduni.c wrstabs.c \
-+	windres.c winduni.c wrcoff.c wrstabs.c \
- 	windmc.c mclex.c
- 
- GENERATED_CFILES = \
-@@ -106,7 +106,7 @@
- 	defparse.c deflex.c nlmheader.c rcparse.c mcparse.c
- 
- DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c
--WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c
-+WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c wrcoff.c
- 
- # Code shared by all the binutils.
- BULIBS = bucomm.c version.c filemode.c
-diff -Nur ../binutils-2.18.orig/binutils/Makefile.in ./binutils/Makefile.in
---- ../binutils-2.18.orig/binutils/Makefile.in	Tue Oct 23 21:44:42 2007
-+++ ./binutils/Makefile.in	Tue Oct 23 22:26:52 2007
-@@ -129,7 +129,7 @@
- nm_new_OBJECTS = $(am_nm_new_OBJECTS)
- nm_new_LDADD = $(LDADD)
- am__objects_2 = rddbg.$(OBJEXT) debug.$(OBJEXT) stabs.$(OBJEXT) \
--	ieee.$(OBJEXT) rdcoff.$(OBJEXT)
-+	ieee.$(OBJEXT) rdcoff.$(OBJEXT) wrcoff.$(OBJEXT)
- am__objects_3 = $(am__objects_2) wrstabs.$(OBJEXT)
- am_objcopy_OBJECTS = objcopy.$(OBJEXT) not-strip.$(OBJEXT) \
- 	rename.$(OBJEXT) $(am__objects_3) $(am__objects_1)
-@@ -418,7 +418,7 @@
- 	resbin.c rescoff.c resrc.c resres.c \
- 	size.c srconv.c stabs.c strings.c sysdump.c \
- 	unwind-ia64.c version.c \
--	windres.c winduni.c wrstabs.c \
-+	windres.c winduni.c wrcoff.c wrstabs.c \
- 	windmc.c mclex.c
- 
- GENERATED_CFILES = \
-@@ -426,7 +426,7 @@
- 	defparse.c deflex.c nlmheader.c rcparse.c mcparse.c
- 
- DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c
--WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c
-+WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c wrcoff.c
- 
- # Code shared by all the binutils.
- BULIBS = bucomm.c version.c filemode.c
-diff -Nur ../binutils-2.18.orig/binutils/bucomm.c ./binutils/bucomm.c
---- ../binutils-2.18.orig/binutils/bucomm.c	Tue Oct 23 21:44:42 2007
-+++ ./binutils/bucomm.c	Tue Oct 23 22:18:44 2007
-@@ -501,6 +501,32 @@
-   return ret;
- }
- 
-+/* Return the basename of "file", i. e. everything minus whatever
-+   directory part has been provided.  Stolen from bfd/archive.c.
-+   Should we also handle the VMS case (as in bfd/archive.c)?  */
-+const char *
-+bu_basename (file)
-+     const char *file;
-+{
-+  const char *filename = strrchr (file, '/');
+diff -Nruw bfd/Makefile.am bfd/Makefile.am
+--- bfd/Makefile.am	2009-10-16 17:17:44.000000000 +0530
++++ bfd/Makefile.am	2010-02-11 10:59:11.320193800 +0530
+@@ -228,6 +228,8 @@
+ 	coff-apollo.lo \
+ 	coff-arm.lo \
+ 	coff-aux.lo \
++        coff-avr.lo \
++        coff-ext-avr.lo \
+ 	coff-go32.lo \
+ 	coff-h8300.lo \
+ 	coff-h8500.lo \
+@@ -411,6 +413,8 @@
+ 	coff-apollo.c \
+ 	coff-arm.c \
+ 	coff-aux.c \
++	coff-avr.c \
++	coff-ext-avr.c \
+ 	coff-go32.c \
+ 	coff-h8300.c \
+ 	coff-h8500.c \
+diff -Nruw bfd/Makefile.in bfd/Makefile.in
+--- bfd/Makefile.in	2009-10-16 17:17:48.000000000 +0530
++++ bfd/Makefile.in	2010-02-11 11:13:52.698455300 +0530
+@@ -524,6 +524,8 @@
+ 	coff-apollo.lo \
+ 	coff-arm.lo \
+ 	coff-aux.lo \
++	coff-avr.lo \
++        coff-ext-avr.lo \
+ 	coff-go32.lo \
+ 	coff-h8300.lo \
+ 	coff-h8500.lo \
+@@ -707,6 +709,8 @@
+ 	coff-apollo.c \
+ 	coff-arm.c \
+ 	coff-aux.c \
++	coff-avr.c \
++	coff-ext-avr.c \
+ 	coff-go32.c \
+ 	coff-h8300.c \
+ 	coff-h8500.c \
+diff -Nruw bfd/coff-avr.c bfd/coff-avr.c
+--- bfd/coff-avr.c	1970-01-01 05:30:00.000000000 +0530
++++ bfd/coff-avr.c	2010-02-10 17:35:58.222099600 +0530
+@@ -0,0 +1,613 @@
++/* BFD back-end for Atmel AVR COFF files.
++   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2003
++   Free Software Foundation, Inc.
++   Created mostly by substituting "avr" for "i860" in coff-i860.c
 +
-+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
-+  {
-+    /* We could have foo/bar\\baz, or foo\\bar, or d:bar.  */
-+    char *bslash = strrchr (file, '\\');
-+    if (filename == NULL || (bslash != NULL && bslash > filename))
-+      filename = bslash;
-+    if (filename == NULL && file[0] != '\0' && file[1] == ':')
-+      filename = file + 1;
-+  }
-+#endif
-+  if (filename != (char *) NULL)
-+    filename++;
-+  else
-+    filename = file;
-+  return filename;
-+}
++This file is part of BFD, the Binary File Descriptor library.
 +
- /* Returns the size of the named file.  If the file does not
-    exist, or if it is not a real file, then a suitable non-fatal
-    error message is printed and zero is returned.  */
-diff -Nur ../binutils-2.18.orig/binutils/bucomm.h ./binutils/bucomm.h
---- ../binutils-2.18.orig/binutils/bucomm.h	Tue Oct 23 21:44:42 2007
-+++ ./binutils/bucomm.h	Tue Oct 23 22:18:44 2007
-@@ -54,6 +54,8 @@
- 
- off_t get_file_size (const char *);
- 
-+const char *bu_basename PARAMS ((const char *));
++This program is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2 of the License, or
++(at your option) any later version.
 +
- extern char *program_name;
- 
- /* filemode.c */
-diff -Nur ../binutils-2.18.orig/binutils/budbg.h ./binutils/budbg.h
---- ../binutils-2.18.orig/binutils/budbg.h	Tue Oct 23 21:44:42 2007
-+++ ./binutils/budbg.h	Tue Oct 23 22:18:44 2007
-@@ -51,8 +51,11 @@
- 
- extern bfd_boolean write_ieee_debugging_info (bfd *, void *);
- 
--/* Routine used to read COFF debugging information.  */
-+/* Routine used to read and write COFF debugging information.  */
- 
- extern bfd_boolean parse_coff (bfd *, asymbol **, long, void *);
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++GNU General Public License for more details.
 +
-+extern bfd_boolean write_coff_debugging_info
-+  (bfd *abfd, void *, long *symcountp, asymbol ***);
- 
- #endif
---- binutils/debug.c.orig	Mon Aug  6 21:55:10 2007
-+++ binutils/debug.c	Tue Oct 23 23:43:19 2007
-@@ -31,6 +31,7 @@
- #include <assert.h>
- #include "bfd.h"
- #include "libiberty.h"
-+#include "bucomm.h"
- #include "debug.h"
- 
- /* Global information we keep for debugging.  A pointer to this
-@@ -552,6 +553,19 @@
-   struct debug_type *t;
- };
- 
-+/* Simple list, used for pathname translations. */
-+struct xlat_list
-+{
-+  /* Next string on list. */
-+  struct xlat_list *next;
-+  /* Old part to match against. */
-+  const char *old;
-+  size_t olen;
-+  /* New part to replace. */
-+  const char *newstr;
-+  size_t nlen;
-+};
++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.  */
 +
- /* Local functions.  */
- 
- static void debug_error (const char *);
-@@ -588,6 +602,11 @@
-   (struct debug_handle *, struct debug_type *, struct debug_type *);
- static bfd_boolean debug_class_type_samep
-   (struct debug_handle *, struct debug_type *, struct debug_type *);
-+static const char *debug_xlat_pathname (const char *);
++#include "bfd.h"
++#include "sysdep.h"
++#include "libbfd.h"
 +
-+/* List of pathname translations. */
-+static struct xlat_list *xlat, *xltail;
-+static bfd_boolean xlat_basename;
- 
- /* Issue an error message.  */
- 
-@@ -680,6 +699,8 @@
- 
-   if (name == NULL)
-     name = "";
-+  else
-+    name = debug_xlat_pathname (name);
- 
-   nfile = (struct debug_file *) xmalloc (sizeof *nfile);
-   memset (nfile, 0, sizeof *nfile);
-@@ -720,6 +741,8 @@
- 
-   if (name == NULL)
-     name = "";
-+  else
-+    name = debug_xlat_pathname (name);
- 
-   if (info->current_unit == NULL)
-     {
-@@ -3369,4 +3392,70 @@
-     }
- 
-   return TRUE;
-+}
++#include "coff/avr.h"
 +
-+/* Register a pathname translation. */
-+void
-+debug_register_pathname_xlat (oname, nname)
-+     const char *oname;
-+     const char *nname;
-+{
-+  struct xlat_list *xlp;
++#include "coff/internal.h"
 +
-+  /* Special case: if oname is given as NULL, this means the
-+     --basename option has been given to objcopy. */
-+  if (oname == NULL)
-+    {
-+      xlat_basename = TRUE;
-+      return;
-+    }
++#include "libcoff.h"
 +
-+  xlp = (struct xlat_list *) xmalloc (sizeof (struct xlat_list));
-+  xlp->next = NULL;
-+  if (xlat == NULL)
-+    xlat = xltail = xlp;
-+  else
-+    {
-+      xltail->next = xlp;
-+      xltail = xlp;
-+    }
-+  xlp->old = oname;
-+  xlp->newstr = nname;
-+  xlp->olen = strlen (oname);
-+  xlp->nlen = strlen (nname);
-+}
++static bfd_reloc_status_type coff_avr_reloc
++  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
++static reloc_howto_type *coff_avr_rtype_to_howto
++  PARAMS ((bfd *, asection *, struct internal_reloc *,
++	   struct coff_link_hash_entry *, struct internal_syment *,
++	   bfd_vma *));
++static const bfd_target * coff_avr_object_p PARAMS ((bfd *));
 +
-+/* Try to translate a pathname. */
-+static const char *
-+debug_xlat_pathname (oname)
-+     const char *oname;
++#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
++/* The page size is a guess based on ELF.  */
++
++#define COFF_PAGE_SIZE 0x1000
++
++/* For some reason when using avr COFF the value stored in the .text
++   section for a reference to a common symbol is the value itself plus
++   any desired offset.  Ian Taylor, Cygnus Support.  */
++
++/* If we are producing relocateable output, we need to do some
++   adjustments to the object file that are not done by the
++   bfd_perform_relocation function.  This function is called by every
++   reloc type to make any required adjustments.  */
++
++static bfd_reloc_status_type
++coff_avr_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
++		 error_message)
++     bfd *abfd;
++     arelent *reloc_entry;
++     asymbol *symbol;
++     PTR data;
++     asection *input_section ATTRIBUTE_UNUSED;
++     bfd *output_bfd;
++     char **error_message ATTRIBUTE_UNUSED;
 +{
-+  struct xlat_list *xlp;
-+  char *cp;
-+  size_t olen;
++  symvalue diff;
 +
-+  if (xlat_basename)
-+    return bu_basename (oname);  
++  if (output_bfd == (bfd *) NULL)
++    return bfd_reloc_continue;
 +
-+  olen = strlen (oname);
-+  for (xlp = xlat; xlp; xlp = xlp->next)
++  if (bfd_is_com_section (symbol->section))
 +    {
-+      if (xlp->olen > olen)
-+	/* This cannot be our turn. */
-+	continue;
-+      /* Since we have pre-computed all our length values to avoid
-+	 repetitively computing them, just use memcmp() since it's
-+	 faster than strcmp(). */
-+      if (memcmp (xlp->old, oname, xlp->olen) == 0)
-+	{
-+	  cp = (char *) xmalloc (olen + xlp->nlen - xlp->olen + 1);
-+	  memcpy (cp, xlp->newstr, xlp->nlen);
-+	  memcpy (cp + xlp->nlen, oname + xlp->olen,
-+		  olen - xlp->olen + 1);
-+	  return cp;
-+	}
++      /* We are relocating a common symbol.  The current value in the
++	 object file is ORIG + OFFSET, where ORIG is the value of the
++	 common symbol as seen by the object file when it was compiled
++	 (this may be zero if the symbol was undefined) and OFFSET is
++	 the offset into the common symbol (normally zero, but may be
++	 non-zero when referring to a field in a common structure).
++	 ORIG is the negative of reloc_entry->addend, which is set by
++	 the CALC_ADDEND macro below.  We want to replace the value in
++	 the object file with NEW + OFFSET, where NEW is the value of
++	 the common symbol which we are going to put in the final
++	 object file.  NEW is symbol->value.  */
++      diff = symbol->value + reloc_entry->addend;
++    }
++  else
++    {
++      /* For some reason bfd_perform_relocation always effectively
++	 ignores the addend for a COFF target when producing
++	 relocateable output.  This seems to be always wrong for 860
++	 COFF, so we handle the addend here instead.  */
++      diff = reloc_entry->addend;
 +    }
 +
-+  /* Not found, pass the original name on. */
-+  return oname;
- }
-diff -Nur ../binutils-2.18.orig/binutils/debug.h ./binutils/debug.h
---- ../binutils-2.18.orig/binutils/debug.h	Tue Oct 23 21:44:43 2007
-+++ ./binutils/debug.h	Tue Oct 23 22:18:44 2007
-@@ -440,6 +440,12 @@
- 
- extern bfd_boolean debug_start_source (void *, const char *);
- 
-+/* Register a pathname translation for source (and include) filenames.
-+   This is used by the --change-pathname option of objcopy. */
-+
-+extern void debug_register_pathname_xlat
-+  PARAMS ((const char *, const char *));
-+
- /* Record a function definition.  This implicitly starts a function
-    block.  The debug_type argument is the type of the return value.
-    The bfd_boolean indicates whether the function is globally visible.
-diff -Nur ../binutils-2.18.orig/binutils/objcopy.c ./binutils/objcopy.c
---- ../binutils-2.18.orig/binutils/objcopy.c	Tue Oct 23 21:44:43 2007
-+++ ./binutils/objcopy.c	Tue Oct 23 22:38:29 2007
-@@ -32,6 +32,7 @@
- #include "elf-bfd.h"
- #include <sys/stat.h>
- #include "libbfd.h"
-+#include "debug.h"
- 
- /* A list of symbols to explicitly strip out, or to keep.  A linked
-    list is good enough for a small number from the command line, but
-@@ -272,7 +273,9 @@
-     OPTION_PURE,
-     OPTION_IMPURE,
-     OPTION_EXTRACT_SYMBOL,
--    OPTION_REVERSE_BYTES
-+    OPTION_REVERSE_BYTES,
-+    OPTION_CHANGE_PATHNAME,
-+    OPTION_BASENAME
-   };
- 
- /* Options to handle if running as "strip".  */
-@@ -316,10 +319,12 @@
-   {"adjust-section-vma", required_argument, 0, OPTION_CHANGE_SECTION_ADDRESS},
-   {"adjust-warnings", no_argument, 0, OPTION_CHANGE_WARNINGS},
-   {"alt-machine-code", required_argument, 0, OPTION_ALT_MACH_CODE},
-+  {"basename", no_argument, 0, OPTION_BASENAME},
-   {"binary-architecture", required_argument, 0, 'B'},
-   {"byte", required_argument, 0, 'b'},
-   {"change-addresses", required_argument, 0, OPTION_CHANGE_ADDRESSES},
-   {"change-leading-char", no_argument, 0, OPTION_CHANGE_LEADING_CHAR},
-+  {"change-pathname", required_argument, 0, OPTION_CHANGE_PATHNAME},
-   {"change-section-address", required_argument, 0, OPTION_CHANGE_SECTION_ADDRESS},
-   {"change-section-lma", required_argument, 0, OPTION_CHANGE_SECTION_LMA},
-   {"change-section-vma", required_argument, 0, OPTION_CHANGE_SECTION_VMA},
-@@ -504,6 +509,8 @@
-      --prefix-alloc-sections <prefix>\n\
-                                    Add <prefix> to start of every allocatable\n\
-                                      section name\n\
-+     --change-pathname <old>=<new> Change debug pathnames from <old> to <new>\n\
-+     --basename                    Strip directory part from debug pathnames\n\
-   -v --verbose                     List all object files modified\n\
-   @<file>                          Read options from <file>\n\
-   -V --version                     Display this program's version number\n\
-@@ -911,6 +918,8 @@
-   asymbol **from = isyms, **to = osyms;
-   long src_count = 0, dst_count = 0;
-   int relocatable = (abfd->flags & (EXEC_P | DYNAMIC)) == 0;
-+  bfd_boolean need_for_debugging = convert_debugging
-+    && bfd_get_arch (abfd) == bfd_arch_avr;
- 
-   for (; src_count < symcount; src_count++)
-     {
-@@ -1010,9 +1019,10 @@
- 	       || bfd_is_com_section (bfd_get_section (sym)))
- 	keep = strip_symbols != STRIP_UNNEEDED;
-       else if ((flags & BSF_DEBUGGING) != 0)	/* Debugging symbol.  */
--	keep = (strip_symbols != STRIP_DEBUG
--		&& strip_symbols != STRIP_UNNEEDED
--		&& ! convert_debugging);
-+	keep = need_for_debugging
-+		|| (strip_symbols != STRIP_DEBUG
-+		    && strip_symbols != STRIP_UNNEEDED
-+		    && ! convert_debugging);
-       else if (bfd_coff_get_comdat_section (abfd, bfd_get_section (sym)))
- 	/* COMDAT sections store special information in local
- 	   symbols, so we cannot risk stripping any of them.  */
-@@ -2588,6 +2598,10 @@
-     return write_ieee_debugging_info (obfd, dhandle);
- 
-   if (bfd_get_flavour (obfd) == bfd_target_coff_flavour
-+      && bfd_get_arch (obfd) == bfd_arch_avr)
-+    return write_coff_debugging_info (obfd, dhandle, symcountp, symppp);
++#define DOIT(x) \
++  x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & howto->dst_mask))
 +
-+  if (bfd_get_flavour (obfd) == bfd_target_coff_flavour
-       || bfd_get_flavour (obfd) == bfd_target_elf_flavour)
-     {
-       bfd_byte *syms, *strings;
-@@ -3287,6 +3301,30 @@
- 
- 	case OPTION_PREFIX_ALLOC_SECTIONS:
- 	  prefix_alloc_sections_string = optarg;
-+	  break;
++    if (diff != 0)
++      {
++	reloc_howto_type *howto = reloc_entry->howto;
++	unsigned char *addr = (unsigned char *) data + reloc_entry->address;
 +
-+	case OPTION_CHANGE_PATHNAME:
++	switch (howto->size)
 +	  {
-+	    const char *s;
-+	    int len;
-+	    char *name;
++	  case 0:
++	    {
++	      char x = bfd_get_8 (abfd, addr);
++	      DOIT (x);
++	      bfd_put_8 (abfd, x, addr);
++	    }
++	    break;
 +
-+	    s = strchr (optarg, '=');
-+	    if (s == NULL)
-+	      fatal (_("bad format for %s"), "--change-pathname");
++	  case 1:
++	    {
++	      short x = bfd_get_16 (abfd, addr);
++	      DOIT (x);
++	      bfd_put_16 (abfd, (bfd_vma) x, addr);
++	    }
++	    break;
 +
-+	    len = s - optarg;
-+	    name = (char *) xmalloc (len + 1);
-+	    strncpy (name, optarg, len);
-+	    name[len] = '\0';
++	  case 2:
++	    {
++	      long x = bfd_get_32 (abfd, addr);
++	      DOIT (x);
++	      bfd_put_32 (abfd, (bfd_vma) x, addr);
++	    }
++	    break;
 +
-+	    debug_register_pathname_xlat (name, s + 1);
++	  default:
++	    abort ();
 +	  }
-+	  break;
++      }
 +
-+	case OPTION_BASENAME:
-+	  /* very special case of pathname translation */
-+	  debug_register_pathname_xlat (NULL, NULL);
- 	  break;
- 
- 	case OPTION_READONLY_TEXT:
-diff -Nur ../binutils-2.18.orig/binutils/rdcoff.c ./binutils/rdcoff.c
---- ../binutils-2.18.orig/binutils/rdcoff.c	Tue Oct 23 21:44:43 2007
-+++ ./binutils/rdcoff.c	Tue Oct 23 22:18:44 2007
-@@ -82,6 +82,9 @@
-   struct coff_slots *slots;
-   /* Basic types.  */
-   debug_type basic[T_MAX + 1];
-+  /* Some general information, kept here for convenience. */
-+  size_t intsize;		/* sizeof (int) */
-+  size_t doublesize;		/* sizeof (double) */
- };
- 
- static debug_type *coff_get_slot (struct coff_types *, int);
-@@ -101,6 +104,7 @@
-   (bfd *, struct coff_types *, asymbol *, long, struct internal_syment *,
-    void *, debug_type, bfd_boolean);
- static bfd_boolean external_coff_symbol_p (int sym_class);
-+static bfd_vma coff_convert_register (bfd *, bfd_vma);
- 
- /* Return the slot for a type.  */
- 
-@@ -271,8 +275,7 @@
-       break;
- 
-     case T_INT:
--      /* FIXME: Perhaps the size should depend upon the architecture.  */
--      ret = debug_make_int_type (dhandle, 4, FALSE);
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/crossavr-binutils/crossavr-binutils-avr-coff.patch?r1=1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/crossavr-binutils/crossavr-binutils-new-sections.patch?r1=1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/crossavr-binutils/crossavr-binutils-xmega.patch?r1=1.1&r2=1.2&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/crossavr-binutils/crossavr-binutils.spec?r1=1.34&r2=1.35&f=u



More information about the pld-cvs-commit mailing list