This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: i386-pc-nto-qnx patch re-submission


On Thu, May 30, 2002 at 12:30:21PM -0400, Graeme Peterson wrote:
> Here is an updated patch for consideration for inclusion in the GNU
> Binutils to support i386-pc-nto-qnx6.  I have also attached a set of
> updated ChangeLog entries.

I've committed the following.  Quite a few formatting fixes, some
tweaks to IS_CONTAINED_BY_FILEPOS, name changes, and ChangeLog entry
cleanups compared to the original diff.

Note how "make dep-am" actually makes correct dependencies.  ;)

bfd/ChangeLog
	* Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo.
	(BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c.
	Run "make dep-am".
	* Makefile.in: Regenerate.
	* config.bfd: Add i[3456]86-*-nto-qnx* support.
	* configure.in: Add bfd_elf32_i386qnx_vec support.
	* configure: Regenerate.
	* elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos,
	is_contained_by_filepos, and copy_private_bfd_data_p.
	* elf.c (assign_file_positions_for_segments): Call backend
	set_nonloadable_filepos.  Fix non-K&R call to _bfd_error_handler.
	(IS_CONTAINED_BY_FILEPOS): Define.
	(INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS.
	(copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS.  Typo fix.
	Fix non-K&R call to _bfd_error_handler.
	(_bfd_elf_copy_private_section_data): Use backend
	copy_private_bfd_data_p.
	* elf32-i386.c: Don't include elfxx-target.h when
	ELF32_I386_C_INCLUDED is defined.
	* elf32-i386qnx.c: New QNX elf backend file.
	* elfxx-target.h: Add elf_backend_set_nonloadable_filepos,
	elf_backend_is_contained_by_filepos, and
	elf_backend_do_copy_private_bfd_data.
	* targets.c: Add bfd_target bfd_elf32_i386qnx_vec.

gas/ChangeLog
	* configure.in: Add i386-*-nto-qnx*.
	* configure: Regenerate.

ld/ChangeLog
	* Makefile.am (ALL_EMULATIONS): Add ei386nto.o.
	(ei386nto.c): Add rule.
	* Makefile.in: Regenerate.
	* configure.tgt: Add i[3456]86-*-nto-qnx*.
	* emulparams/i386nto.sh: New file.

Index: bfd/Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.85
diff -u -p -r1.85 Makefile.am
--- bfd/Makefile.am	30 May 2002 02:14:11 -0000	1.85
+++ bfd/Makefile.am	31 May 2002 02:21:50 -0000
@@ -207,6 +207,7 @@ BFD32_BACKENDS = \
 	elf32-hppa.lo \
 	elf32-i370.lo \
 	elf32-i386.lo \
+	elf32-i386qnx.lo \
 	elf32-i860.lo \
 	elf32-i960.lo \
 	elf32-ia64.lo \
@@ -358,6 +359,7 @@ BFD32_BACKENDS_CFILES = \
 	elf32-hppa.c \
 	elf32-i370.c \
 	elf32-i386.c \
+	elf32-i386qnx.c \
 	elf32-i860.c \
 	elf32-i960.c \
 	elf32-m32r.c \
@@ -873,7 +875,7 @@ cpu-avr.lo: cpu-avr.c $(INCDIR)/filename
 cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h
 cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h
 cpu-d30v.lo: cpu-d30v.c $(INCDIR)/filenames.h
-cpu-dlx.lo: cpu-d30v.c $(INCDIR)/filenames.h
+cpu-dlx.lo: cpu-dlx.c $(INCDIR)/filenames.h
 cpu-fr30.lo: cpu-fr30.c $(INCDIR)/filenames.h
 cpu-h8300.lo: cpu-h8300.c $(INCDIR)/filenames.h
 cpu-h8500.lo: cpu-h8500.c $(INCDIR)/filenames.h
@@ -1116,6 +1118,10 @@ elf32-i386.lo: elf32-i386.c $(INCDIR)/fi
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \
   elf32-target.h
+elf32-i386qnx.lo: elf32-i386qnx.c elf32-i386.c $(INCDIR)/filenames.h \
+  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h \
+  $(INCDIR)/elf/reloc-macros.h elf32-target.h
 elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \
@@ -1215,7 +1221,7 @@ elf32-v850.lo: elf32-v850.c $(INCDIR)/fi
 elf32-vax.lo: elf32-vax.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/vax.h $(INCDIR)/elf/reloc-macros.h \
-  $(INCDIR)/libiberty.h elf32-target.h
+  elf32-target.h
 elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \
Index: bfd/config.bfd
===================================================================
RCS file: /cvs/src/src/bfd/config.bfd,v
retrieving revision 1.96
diff -u -p -r1.96 config.bfd
--- bfd/config.bfd	30 May 2002 02:14:13 -0000	1.96
+++ bfd/config.bfd	31 May 2002 02:21:55 -0000
@@ -346,6 +346,10 @@ case "${targ}" in
     targ_defvec=bfd_elf32_i386_vec
     targ_selvecs=i386coff_vec
     ;;
+  i[3456]86-*-nto-qnx*)
+    targ_defvec=bfd_elf32_i386qnx_vec
+    targ_selvecs=i386coff_vec
+    ;;
   i[3456]86-*-chorus*)
     targ_defvec=bfd_elf32_i386_vec
     ;;
Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.97
diff -u -p -r1.97 configure.in
--- bfd/configure.in	30 May 2002 02:14:12 -0000	1.97
+++ bfd/configure.in	31 May 2002 02:22:01 -0000
@@ -573,6 +573,7 @@ do
     bfd_elf32_hppa_vec)		tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_i370_vec)		tb="$tb elf32-i370.lo elf32.lo $elf" ;;
     bfd_elf32_i386_vec)		tb="$tb elf32-i386.lo elf32.lo $elf" ;;
+    bfd_elf32_i386qnx_vec)	tb="$tb elf32-i386qnx.lo elf32.lo $elf" ;;
     bfd_elf32_i860_little_vec)	tb="$tb elf32-i860.lo elf32.lo $elf" ;;
     bfd_elf32_i860_vec)		tb="$tb elf32-i860.lo elf32.lo $elf" ;;
     bfd_elf32_i960_vec)		tb="$tb elf32-i960.lo elf32.lo $elf" ;;
Index: bfd/elf-bfd.h
===================================================================
RCS file: /cvs/src/src/bfd/elf-bfd.h,v
retrieving revision 1.72
diff -u -p -r1.72 elf-bfd.h
--- bfd/elf-bfd.h	23 May 2002 13:12:47 -0000	1.72
+++ bfd/elf-bfd.h	31 May 2002 02:22:04 -0000
@@ -760,6 +760,22 @@ struct elf_backend_data
   boolean (*elf_backend_write_section)
     PARAMS ((bfd *, asection *, bfd_byte *));
 
+  /* This function, if defined, sets  up the file positions for non PT_LOAD
+     segments, especially for segments containing non-allocated sections.  */
+  void (*set_nonloadable_filepos)
+    PARAMS ((bfd *, Elf_Internal_Phdr *));
+
+  /* This function, if defined, returns true if the section is contained
+     within the segment.  File positions are compared.  */
+  boolean (*is_contained_by_filepos)
+    PARAMS ((asection *, Elf_Internal_Phdr *));
+
+  /* This function, if defined, returns true if copy_private_bfd_data
+     should be called.  It provides a way of overriding default 
+     test conditions in _bfd_elf_copy_private_section_data.  */
+  boolean (*copy_private_bfd_data_p)
+    PARAMS ((bfd *, asection *, bfd *, asection *));
+
   /* The level of IRIX compatibility we're striving for.
      MIPS ELF specific function.  */
   irix_compat_t (*elf_backend_mips_irix_compat)
Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.139
diff -u -p -r1.139 elf.c
--- bfd/elf.c	23 May 2002 13:12:43 -0000	1.139
+++ bfd/elf.c	31 May 2002 02:22:09 -0000
@@ -3477,8 +3477,9 @@ assign_file_positions_for_segments (abfd
 
 	      if (p->p_vaddr < (bfd_vma) off)
 		{
-		  _bfd_error_handler (_("%s: Not enough room for program headers, try linking with -N"),
-				      bfd_get_filename (abfd));
+		  (*_bfd_error_handler)
+		    (_("%s: Not enough room for program headers, try linking with -N"),
+		     bfd_get_filename (abfd));
 		  bfd_set_error (bfd_error_bad_value);
 		  return false;
 		}
@@ -3716,6 +3717,11 @@ Error: First section in segment (%s) sta
 	}
     }
 
+  /* If additional nonloadable filepos adjustments are required,
+     do them now. */
+  if (bed->set_nonloadable_filepos)
+    (*bed->set_nonloadable_filepos) (abfd, phdrs);
+
   /* Clear out any program headers we allocated but did not use.  */
   for (; count < alloc; count++, p++)
     {
@@ -4274,6 +4280,7 @@ copy_private_bfd_data (ibfd, obfd)
   bfd_vma                   maxpagesize;
   struct elf_segment_map *  phdr_adjust_seg = NULL;
   unsigned int              phdr_adjust_num = 0;
+  struct elf_backend_data * bed;
 
   if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
       || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
@@ -4282,6 +4289,7 @@ copy_private_bfd_data (ibfd, obfd)
   if (elf_tdata (ibfd)->phdr == NULL)
     return true;
 
+  bed = get_elf_backend_data (ibfd);
   iehdr = elf_elfheader (ibfd);
 
   map_first = NULL;
@@ -4309,6 +4317,13 @@ copy_private_bfd_data (ibfd, obfd)
      && (section->lma + section->_raw_size)		\
      <= SEGMENT_END (segment, base))
 
+  /* Returns true if the given section is contained within the
+     given segment.  Filepos addresses are compared in an elf
+     backend function. */
+#define IS_CONTAINED_BY_FILEPOS(sec, seg, bed)		\
+  (bed->is_contained_by_filepos		  		\
+   && (*bed->is_contained_by_filepos) (sec, seg))
+
   /* Special case: corefile "NOTE" section containing regs, prpsinfo etc.  */
 #define IS_COREFILE_NOTE(p, s)                          \
 	    (p->p_type == PT_NOTE                       \
@@ -4337,13 +4352,15 @@ copy_private_bfd_data (ibfd, obfd)
        2. It is an allocated segment,
        3. There is an output section associated with it,
        4. The section has not already been allocated to a previous segment.  */
-#define INCLUDE_SECTION_IN_SEGMENT(section, segment)			\
+#define INCLUDE_SECTION_IN_SEGMENT(section, segment, bed)		\
   (((((segment->p_paddr							\
        ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr)	\
        : IS_CONTAINED_BY_VMA (section, segment))			\
       || IS_SOLARIS_PT_INTERP (segment, section))			\
      && (section->flags & SEC_ALLOC) != 0)				\
-    || IS_COREFILE_NOTE (segment, section))				\
+    || IS_COREFILE_NOTE (segment, section)				\
+    || (IS_CONTAINED_BY_FILEPOS (section, segment, bed)			\
+        && (section->flags & SEC_ALLOC) == 0))				\
    && section->output_section != NULL					\
    && section->segment_mark == false)
 
@@ -4443,7 +4460,7 @@ copy_private_bfd_data (ibfd, obfd)
       /* Compute how many sections might be placed into this segment.  */
       section_count = 0;
       for (section = ibfd->sections; section != NULL; section = section->next)
-	if (INCLUDE_SECTION_IN_SEGMENT (section, segment))
+	if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed))
 	  ++section_count;
 
       /* Allocate a segment map big enough to contain all of the
@@ -4488,9 +4505,9 @@ copy_private_bfd_data (ibfd, obfd)
 	     no sections, but ordinary, loadable segments should contain
 	     something.  */
 	  if (segment->p_type == PT_LOAD)
-	      _bfd_error_handler
-		(_("%s: warning: Empty loadable segment detected\n"),
-		 bfd_archive_filename (ibfd));
+	    (*_bfd_error_handler)
+	      (_("%s: warning: Empty loadable segment detected\n"),
+	       bfd_archive_filename (ibfd));
 
 	  map->count = 0;
 	  *pointer_to_map = map;
@@ -4546,7 +4563,7 @@ copy_private_bfd_data (ibfd, obfd)
 	   section != NULL;
 	   section = section->next)
 	{
-	  if (INCLUDE_SECTION_IN_SEGMENT (section, segment))
+	  if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed))
 	    {
 	      output_section = section->output_section;
 
@@ -4572,6 +4589,7 @@ copy_private_bfd_data (ibfd, obfd)
 	      /* Match up the physical address of the segment with the
 		 LMA address of the output section.  */
 	      if (IS_CONTAINED_BY_LMA (output_section, segment, map->p_paddr)
+		  || IS_CONTAINED_BY_FILEPOS (section, segment, bed)
 		  || IS_COREFILE_NOTE (segment, section))
 		{
 		  if (matching_lma == 0)
@@ -4641,7 +4659,7 @@ copy_private_bfd_data (ibfd, obfd)
 	}
 
       /* Step Three: Loop over the sections again, this time assigning
-	 those that fit to the current segment and remvoing them from the
+	 those that fit to the current segment and removing them from the
 	 sections array; but making sure not to leave large gaps.  Once all
 	 possible sections have been assigned to the current segment it is
 	 added to the list of built segments and if sections still remain
@@ -4692,7 +4710,7 @@ copy_private_bfd_data (ibfd, obfd)
 			 maxpagesize then we need to start a new segment.  */
 		      if ((BFD_ALIGN (prev_sec->lma + prev_sec->_raw_size,
 				      maxpagesize)
-			  < BFD_ALIGN (output_section->lma, maxpagesize))
+			   < BFD_ALIGN (output_section->lma, maxpagesize))
 			  || ((prev_sec->lma + prev_sec->_raw_size)
 			      > output_section->lma))
 			{
@@ -4805,6 +4823,7 @@ copy_private_bfd_data (ibfd, obfd)
 #undef SEGMENT_END
 #undef IS_CONTAINED_BY_VMA
 #undef IS_CONTAINED_BY_LMA
+#undef IS_CONTAINED_BY_FILEPOS
 #undef IS_COREFILE_NOTE
 #undef IS_SOLARIS_PT_INTERP
 #undef INCLUDE_SECTION_IN_SEGMENT
@@ -4824,6 +4843,7 @@ _bfd_elf_copy_private_section_data (ibfd
      asection *osec;
 {
   Elf_Internal_Shdr *ihdr, *ohdr;
+  const struct elf_backend_data *bed = get_elf_backend_data (ibfd);
 
   if (ibfd->xvec->flavour != bfd_target_elf_flavour
       || obfd->xvec->flavour != bfd_target_elf_flavour)
@@ -4833,24 +4853,31 @@ _bfd_elf_copy_private_section_data (ibfd
      This must be done here, rather than in the copy_private_bfd_data
      entry point, because the latter is called after the section
      contents have been set, which means that the program headers have
-     already been worked out.  */
-  if (elf_tdata (obfd)->segment_map == NULL
-      && elf_tdata (ibfd)->phdr != NULL)
-    {
-      asection *s;
-
-      /* Only set up the segments if there are no more SEC_ALLOC
-         sections.  FIXME: This won't do the right thing if objcopy is
-         used to remove the last SEC_ALLOC section, since objcopy
-         won't call this routine in that case.  */
-      for (s = isec->next; s != NULL; s = s->next)
-	if ((s->flags & SEC_ALLOC) != 0)
-	  break;
-      if (s == NULL)
-	{
-	  if (! copy_private_bfd_data (ibfd, obfd))
-	    return false;
-	}
+     already been worked out.  The backend function provides a way to 
+     override the test conditions and code path for the call to 
+     copy_private_bfd_data.  */
+  if (bed->copy_private_bfd_data_p)
+    {
+      if ((*bed->copy_private_bfd_data_p) (ibfd, isec, obfd, osec))
+        if (! copy_private_bfd_data (ibfd, obfd))
+          return false;
+    } 
+  else if (elf_tdata (obfd)->segment_map == NULL && elf_tdata (ibfd)->phdr != NULL)
+    {
+	asection *s;
+
+	/* Only set up the segments if there are no more SEC_ALLOC
+	   sections.  FIXME: This won't do the right thing if objcopy is
+	   used to remove the last SEC_ALLOC section, since objcopy
+	   won't call this routine in that case.  */
+	for (s = isec->next; s != NULL; s = s->next)
+	  if ((s->flags & SEC_ALLOC) != 0)
+	    break;
+	if (s == NULL)
+	  {
+	    if (! copy_private_bfd_data (ibfd, obfd))
+	      return false;
+	  }
     }
 
   ihdr = &elf_section_data (isec)->this_hdr;
Index: bfd/elf32-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i386.c,v
retrieving revision 1.70
diff -u -p -r1.70 elf32-i386.c
--- bfd/elf32-i386.c	23 May 2002 13:12:45 -0000	1.70
+++ bfd/elf32-i386.c	31 May 2002 02:22:11 -0000
@@ -3146,4 +3146,6 @@ elf_i386_finish_dynamic_sections (output
 #define elf_backend_relocate_section	      elf_i386_relocate_section
 #define elf_backend_size_dynamic_sections     elf_i386_size_dynamic_sections
 
+#ifndef ELF32_I386_C_INCLUDED
 #include "elf32-target.h"
+#endif
Index: bfd/elf32-i386qnx.c
===================================================================
RCS file: bfd/elf32-i386qnx.c
diff -N bfd/elf32-i386qnx.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ bfd/elf32-i386qnx.c	31 May 2002 02:22:11 -0000
@@ -0,0 +1,111 @@
+/* Intel 80386/80486 QNX specific support for 32-bit ELF
+   Copyright 2002
+   Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+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.
+
+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.
+
+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.  */
+
+#define ELF32_I386_C_INCLUDED
+#include "elf32-i386.c"
+
+  /* Returns the end address of the segment + 1.  */
+#define SEGMENT_END(segment, start)                     \
+  (start + (segment->p_memsz > segment->p_filesz        \
+   ? segment->p_memsz : segment->p_filesz))
+
+static boolean elf_i386qnx_copy_private_bfd_data_p
+  PARAMS ((bfd *, asection *, bfd *, asection *));
+static boolean elf_i386qnx_is_contained_by_filepos
+  PARAMS ((asection *, Elf_Internal_Phdr *));
+static void elf_i386qnx_set_nonloadable_filepos
+  PARAMS ((bfd *, Elf_Internal_Phdr *));
+
+static boolean
+elf_i386qnx_copy_private_bfd_data_p (ibfd, isec, obfd, osec)
+     bfd *ibfd;
+     asection *isec;
+     bfd *obfd;
+     asection *osec;
+{
+  /* We don't use these parameters, but another target might. */
+  ibfd = ibfd;
+  obfd = obfd;
+  osec = osec;
+  return isec->next == NULL;
+}
+
+static boolean
+elf_i386qnx_is_contained_by_filepos (section, segment)
+     asection *section;
+     Elf_Internal_Phdr *segment; 
+{
+  return ((bfd_vma) section->filepos >= segment->p_offset
+          && ((bfd_vma) section->filepos + section->_raw_size
+	      <= SEGMENT_END (segment, segment->p_offset)));
+}
+
+static void
+elf_i386qnx_set_nonloadable_filepos (abfd, phdrs)
+     bfd *abfd;
+     Elf_Internal_Phdr *phdrs; 
+{
+  struct elf_segment_map *m;
+  Elf_Internal_Phdr *p;
+  file_ptr off = 0;
+
+  for (m = elf_tdata (abfd)->segment_map, p = phdrs;
+       m != NULL;
+       m = m->next, p++)
+    {
+      unsigned int i;
+      asection **secpp;
+
+      for (i = 0, secpp = m->sections; i < m->count; i++, secpp++)
+        {
+          asection *sec;
+
+          sec = *secpp;
+
+          if (p->p_type == PT_LOAD)
+	    off = sec->filepos;
+          else
+            {
+              if (i == 0)
+                {
+                  if (sec->filepos)
+                    p->p_offset = sec->filepos;
+                  else
+                    p->p_offset = off;
+                }
+              if (!sec->filepos)
+                {
+                  off += sec->_raw_size;
+                  p->p_filesz += sec->_raw_size;
+                }
+            }
+        }
+    }
+  return;
+}
+
+#undef  TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM		    bfd_elf32_i386qnx_vec
+
+#define elf_backend_set_nonloadable_filepos elf_i386qnx_set_nonloadable_filepos
+#define elf_backend_is_contained_by_filepos elf_i386qnx_is_contained_by_filepos
+#define elf_backend_copy_private_bfd_data_p elf_i386qnx_copy_private_bfd_data_p
+
+#include "elf32-target.h"
Index: bfd/elfxx-target.h
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-target.h,v
retrieving revision 1.42
diff -u -p -r1.42 elfxx-target.h
--- bfd/elfxx-target.h	29 May 2002 05:00:01 -0000	1.42
+++ bfd/elfxx-target.h	31 May 2002 02:22:23 -0000
@@ -378,6 +378,15 @@ Foundation, Inc., 59 Temple Place - Suit
 #ifndef elf_backend_write_section
 #define elf_backend_write_section		NULL
 #endif
+#ifndef elf_backend_set_nonloadable_filepos
+#define elf_backend_set_nonloadable_filepos	NULL
+#endif
+#ifndef elf_backend_is_contained_by_filepos
+#define elf_backend_is_contained_by_filepos	NULL
+#endif
+#ifndef elf_backend_copy_private_bfd_data_p
+#define elf_backend_copy_private_bfd_data_p	NULL
+#endif
 #ifndef elf_backend_mips_irix_compat
 #define elf_backend_mips_irix_compat		NULL
 #endif
@@ -479,6 +488,9 @@ static const struct elf_backend_data elf
   elf_backend_discard_info,
   elf_backend_ignore_discarded_relocs,
   elf_backend_write_section,
+  elf_backend_set_nonloadable_filepos,
+  elf_backend_is_contained_by_filepos,
+  elf_backend_copy_private_bfd_data_p,
   elf_backend_mips_irix_compat,
   elf_backend_mips_rtype_to_howto,
   elf_backend_ecoff_debug_swap,
Index: bfd/targets.c
===================================================================
RCS file: /cvs/src/src/bfd/targets.c,v
retrieving revision 1.62
diff -u -p -r1.62 targets.c
--- bfd/targets.c	30 May 2002 02:14:13 -0000	1.62
+++ bfd/targets.c	31 May 2002 02:22:26 -0000
@@ -514,6 +514,7 @@ extern const bfd_target bfd_elf32_hppa_l
 extern const bfd_target bfd_elf32_hppa_vec;
 extern const bfd_target bfd_elf32_i370_vec;
 extern const bfd_target bfd_elf32_i386_vec;
+extern const bfd_target bfd_elf32_i386qnx_vec;
 extern const bfd_target bfd_elf32_i860_little_vec;
 extern const bfd_target bfd_elf32_i860_vec;
 extern const bfd_target bfd_elf32_i960_vec;
@@ -766,6 +767,7 @@ static const bfd_target * const _bfd_tar
 	&bfd_elf32_hppa_vec,
 	&bfd_elf32_i370_vec,
 	&bfd_elf32_i386_vec,
+	&bfd_elf32_i386qnx_vec,
 	&bfd_elf32_i860_little_vec,
 	&bfd_elf32_i860_vec,
 	&bfd_elf32_i960_vec,
Index: gas/configure.in
===================================================================
RCS file: /cvs/src/src/gas/configure.in,v
retrieving revision 1.104
diff -u -p -r1.104 configure.in
--- gas/configure.in	28 May 2002 14:07:47 -0000	1.104
+++ gas/configure.in	31 May 2002 02:22:39 -0000
@@ -300,6 +300,7 @@ changequote([,])dnl
       i386-*-cygwin*)       fmt=coff em=pe bfd_gas=yes ;;
       i386-*-interix*)	    fmt=coff em=interix bfd_gas=yes ;;
       i386-*-mingw32*)      fmt=coff em=pe bfd_gas=yes ;;
+      i386-*-nto-qnx*)	    fmt=elf ;;
       i386-*-*nt*)          fmt=coff em=pe bfd_gas=yes ;;
       i386-*-vxworks*)      fmt=aout ;;
       i386-*-chaos)         fmt=elf ;;
Index: ld/Makefile.am
===================================================================
RCS file: /cvs/src/src/ld/Makefile.am,v
retrieving revision 1.99
diff -u -p -r1.99 Makefile.am
--- ld/Makefile.am	30 May 2002 02:40:00 -0000	1.99
+++ ld/Makefile.am	31 May 2002 02:23:25 -0000
@@ -208,6 +208,7 @@ ALL_EMULATIONS = \
 	ei386moss.o \
 	ei386msdos.o \
 	ei386nbsd.o \
+	ei386nto.o \
 	ei386nw.o \
 	ei386pe.o \
 	ei386pe_posix.o \
@@ -795,6 +796,9 @@ ei386msdos.c: $(srcdir)/emulparams/i386m
 ei386nbsd.c:	$(srcdir)/emulparams/i386nbsd.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} i386nbsd "$(tdir_i386nbsd)"
+ei386nto.c:	$(srcdir)/emulparams/i386nto.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} i386nto "$(tdir_i386nto)"
 ei386nw.c:	$(srcdir)/emulparams/i386nw.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} i386nw "$(tdir_i386nw)"
Index: ld/configure.tgt
===================================================================
RCS file: /cvs/src/src/ld/configure.tgt,v
retrieving revision 1.92
diff -u -p -r1.92 configure.tgt
--- ld/configure.tgt	30 May 2002 02:40:00 -0000	1.92
+++ ld/configure.tgt	31 May 2002 02:23:33 -0000
@@ -119,6 +119,7 @@ m68*-ericsson-ose)	targ_emul=sun3 ;;
 m68*-apple-aux*)	targ_emul=m68kaux ;;
 *-tandem-none)		targ_emul=st2000 ;;
 i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
+i[3456]86-*-nto-qnx*)	targ_emul=i386nto ;;
 i[3456]86-*-vsta)	targ_emul=vsta ;;
 i[3456]86-go32-rtems*)	targ_emul=i386go32 ;;
 i[3456]86-*-go32)	targ_emul=i386go32 ;;
Index: ld/emulparams/i386nto.sh
===================================================================
RCS file: ld/emulparams/i386nto.sh
diff -N ld/emulparams/i386nto.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/emulparams/i386nto.sh	31 May 2002 02:23:33 -0000
@@ -0,0 +1,12 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-i386"
+TEXT_START_ADDR=0x08048000
+TEXT_START_SYMBOLS='_btext = .;'
+MAXPAGESIZE=0x1000
+NONPAGED_TEXT_START_ADDR=0x08048000
+#SHLIB_TEXT_START_ADDR=0xb0300000
+ARCH=i386
+MACHINE=
+NOP=0x9090
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]