i386-pc-nto-qnx patch

Graeme Peterson gp@qnx.com
Wed Apr 17 13:05:00 GMT 2002


Hi, all.

Here is a patch for i386-pc-nto-qnx for inclusion in
GNU binutils.  Thanks to all for your help.

I have followed Daniel Jacobowitz' suggestion regarding
including bfd/elf32-i386.c in the new bfd/elf32-i386qnx.c
to facilitate adding our own elf backend.

A couple of areas to point out for your consideration:

- bfd/elf.c _bfd_elf_copy_private_section_data()
  I have some code that I have flagged with a FIXME.
  
- ld/emultempl/elf32.em
  I have a #if 0 with a comment.  This is so you can see
  why I think the code should be removed in the general case
  for everyone, and then we can comment on the correctness
  or lack thereof.


The new backend function is elf_backend_set_nonloadable_filepos().
I have been on a learning curve, and it turns out the PT_SEGREL
that I thought was loadable is not.

Thanks.
Looking forward to any feedback.
GP



-------------- next part --------------
diff -rc3p -N src.orig/bfd/Makefile.am src/bfd/Makefile.am
*** src.orig/bfd/Makefile.am	Thu Apr  4 09:04:38 2002
--- src/bfd/Makefile.am	Thu Apr  4 16:58:35 2002
*************** BFD32_BACKENDS = \
*** 202,207 ****
--- 202,208 ----
  	elf32-hppa.lo \
  	elf32-i370.lo \
  	elf32-i386.lo \
+ 	elf32-i386qnx.lo \
  	elf32-i860.lo \
  	elf32-i960.lo \
  	elf32-ia64.lo \
*************** BFD32_BACKENDS_CFILES = \
*** 351,356 ****
--- 352,358 ----
  	elf32-hppa.c \
  	elf32-i370.c \
  	elf32-i386.c \
+ 	elf32-i386qnx.c \
  	elf32-i860.c \
  	elf32-i960.c \
  	elf32-m32r.c \
*************** elf32-i370.lo: elf32-i370.c $(INCDIR)/fi
*** 1079,1084 ****
--- 1081,1090 ----
    elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
    $(INCDIR)/elf/external.h $(INCDIR)/elf/i370.h elf32-target.h
  elf32-i386.lo: 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-i386qnx.lo: elf32-i386qnx.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
diff -rc3p -N src.orig/bfd/Makefile.in src/bfd/Makefile.in
*** src.orig/bfd/Makefile.in	Thu Apr  4 09:04:38 2002
--- src/bfd/Makefile.in	Thu Apr  4 16:58:35 2002
*************** BFD32_BACKENDS = \
*** 330,335 ****
--- 330,336 ----
  	elf32-hppa.lo \
  	elf32-i370.lo \
  	elf32-i386.lo \
+ 	elf32-i386qnx.lo \
  	elf32-i860.lo \
  	elf32-i960.lo \
  	elf32-ia64.lo \
*************** BFD32_BACKENDS_CFILES = \
*** 480,485 ****
--- 481,487 ----
  	elf32-hppa.c \
  	elf32-i370.c \
  	elf32-i386.c \
+ 	elf32-i386qnx.c \
  	elf32-i860.c \
  	elf32-i960.c \
  	elf32-m32r.c \
*************** elf32-i370.lo: elf32-i370.c $(INCDIR)/fi
*** 1623,1628 ****
--- 1625,1634 ----
    elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
    $(INCDIR)/elf/external.h $(INCDIR)/elf/i370.h elf32-target.h
  elf32-i386.lo: 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-i386qnx.lo: elf32-i386qnx.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
diff -rc3p -N src.orig/bfd/config.bfd src/bfd/config.bfd
*** src.orig/bfd/config.bfd	Mon Mar 18 07:45:37 2002
--- src/bfd/config.bfd	Mon Mar 25 14:29:14 2002
*************** case "${targ}" in
*** 336,341 ****
--- 336,345 ----
      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
      ;;
diff -rc3p -N src.orig/bfd/configure src/bfd/configure
*** src.orig/bfd/configure	Sun Apr  7 17:49:08 2002
--- src/bfd/configure	Tue Apr  9 17:43:01 2002
*************** do
*** 6005,6010 ****
--- 6005,6011 ----
      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" ;;
diff -rc3p -N src.orig/bfd/configure.in src/bfd/configure.in
*** src.orig/bfd/configure.in	Sun Apr  7 17:49:09 2002
--- src/bfd/configure.in	Tue Apr  9 17:43:01 2002
*************** do
*** 562,567 ****
--- 562,568 ----
      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" ;;
diff -rc3p -N src.orig/bfd/elf-bfd.h src/bfd/elf-bfd.h
*** src.orig/bfd/elf-bfd.h	Thu Apr  4 02:01:19 2002
--- src/bfd/elf-bfd.h	Thu Apr  4 17:47:02 2002
*************** struct elf_backend_data
*** 748,753 ****
--- 748,758 ----
    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 (*elf_backend_set_nonloadable_filepos)
+     PARAMS ((bfd *, Elf_Internal_Phdr *));
+ 
    /* The level of IRIX compatibility we're striving for.
       MIPS ELF specific function.  */
    irix_compat_t (*elf_backend_mips_irix_compat)
diff -rc3p -N src.orig/bfd/elf.c src/bfd/elf.c
*** src.orig/bfd/elf.c	Thu Apr 11 23:30:56 2002
--- src/bfd/elf.c	Wed Apr 17 15:48:24 2002
*************** Error: First section in segment (%s) sta
*** 3649,3654 ****
--- 3649,3659 ----
  	}
      }
  
+   /* If additional nonloadable filepos adjustments are required,
+      do them now. */
+   if (bed->elf_backend_set_nonloadable_filepos)
+     bed->elf_backend_set_nonloadable_filepos(abfd, phdrs);
+ 
    /* Clear out any program headers we allocated but did not use.  */
    for (; count < alloc; count++, p++)
      {
*************** copy_private_bfd_data (ibfd, obfd)
*** 4232,4237 ****
--- 4237,4249 ----
       && (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.  */
+ #define IS_CONTAINED_BY_FILEPOS(section, segment)		\
+     ((unsigned) section->filepos >= segment->p_offset		\
+      && ((unsigned) section->filepos + section->_raw_size)      \
+      <= SEGMENT_END (segment, segment->p_offset))
+ 
    /* Special case: corefile "NOTE" section containing regs, prpsinfo etc.  */
  #define IS_COREFILE_NOTE(p, s)                          \
  	    (p->p_type == PT_NOTE                       \
*************** copy_private_bfd_data (ibfd, obfd)
*** 4266,4272 ****
         : IS_CONTAINED_BY_VMA (section, segment))			\
        || IS_SOLARIS_PT_INTERP (segment, section))			\
       && (section->flags & SEC_ALLOC) != 0)				\
!     || IS_COREFILE_NOTE (segment, section))				\
     && section->output_section != NULL					\
     && section->segment_mark == false)
  
--- 4278,4286 ----
         : IS_CONTAINED_BY_VMA (section, segment))			\
        || IS_SOLARIS_PT_INTERP (segment, section))			\
       && (section->flags & SEC_ALLOC) != 0)				\
!     || IS_COREFILE_NOTE (segment, section)				\
!     || (IS_CONTAINED_BY_FILEPOS (section, segment)			\
!      && (section->flags & SEC_ALLOC) == 0))				\
     && section->output_section != NULL					\
     && section->segment_mark == false)
  
*************** copy_private_bfd_data (ibfd, obfd)
*** 4278,4284 ****
  #define SEGMENT_OVERLAPS(seg1, seg2)			\
    (!(SEGMENT_AFTER_SEGMENT (seg1, seg2) || SEGMENT_AFTER_SEGMENT (seg2, seg1)))
  
-   /* Initialise the segment mark field.  */
    for (section = ibfd->sections; section != NULL; section = section->next)
      section->segment_mark = false;
  
--- 4292,4297 ----
*************** copy_private_bfd_data (ibfd, obfd)
*** 4495,4500 ****
--- 4508,4514 ----
  	      /* 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)
  		  || IS_COREFILE_NOTE (segment, section))
  		{
  		  if (matching_lma == 0)
*************** copy_private_bfd_data (ibfd, obfd)
*** 4564,4570 ****
  	}
  
        /* Step Three: Loop over the sections again, this time assigning
! 	 those that fit to the current segment and remvoing 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
--- 4578,4584 ----
  	}
  
        /* Step Three: Loop over the sections again, this time assigning
! 	 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
*************** copy_private_bfd_data (ibfd, obfd)
*** 4728,4733 ****
--- 4742,4748 ----
  #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
*************** _bfd_elf_copy_private_section_data (ibfd
*** 4747,4752 ****
--- 4762,4768 ----
       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)
*************** _bfd_elf_copy_private_section_data (ibfd
*** 4760,4779 ****
    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;
--- 4776,4812 ----
    if (elf_tdata (obfd)->segment_map == NULL
        && elf_tdata (ibfd)->phdr != NULL)
      {
!       /* If we have elf_backend_set_nonloadable_filepos function,
! 	 don't check against SEC_ALLOC, as we want to set up the 
! 	 segments anyways.  
! 	 FIXME - this is currently only defined for QNX, and if 
! 	 anyone else defines this function, they may not want this 
! 	 behavior. */
!       if (bed->elf_backend_set_nonloadable_filepos)
  	{
! 	  if (isec->next == NULL)
! 	    {
! 	      if (! copy_private_bfd_data (ibfd, obfd))
! 	      return false;
! 	    }
  	}
+       else
+ 	{
+ 	  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;
diff -rc3p -N src.orig/bfd/elf32-i386.c src/bfd/elf32-i386.c
*** src.orig/bfd/elf32-i386.c	Thu Apr  4 14:53:36 2002
--- src/bfd/elf32-i386.c	Thu Apr  4 16:58:43 2002
*************** elf_i386_finish_dynamic_sections (output
*** 2466,2469 ****
--- 2466,2471 ----
  #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
diff -rc3p -N src.orig/bfd/elf32-i386qnx.c src/bfd/elf32-i386qnx.c
*** src.orig/bfd/elf32-i386qnx.c	Wed Dec 31 19:00:00 1969
--- src/bfd/elf32-i386qnx.c	Wed Apr 17 15:48:44 2002
***************
*** 0 ****
--- 1,76 ----
+ /* 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"
+ 
+ static void elf_i386qnx_set_nonloadable_filepos
+   PARAMS ((bfd *, Elf_Internal_Phdr *));
+ 
+ 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
+ 
+ #include "elf32-target.h"
diff -rc3p -N src.orig/bfd/elfxx-target.h src/bfd/elfxx-target.h
*** src.orig/bfd/elfxx-target.h	Thu Apr  4 14:53:37 2002
--- src/bfd/elfxx-target.h	Thu Apr  4 17:44:48 2002
*************** Foundation, Inc., 59 Temple Place - Suit
*** 371,376 ****
--- 371,379 ----
  #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_mips_irix_compat
  #define elf_backend_mips_irix_compat		NULL
  #endif
*************** static const struct elf_backend_data elf
*** 468,473 ****
--- 471,477 ----
    elf_backend_discard_info,
    elf_backend_ignore_discarded_relocs,
    elf_backend_write_section,
+   elf_backend_set_nonloadable_filepos,
    elf_backend_mips_irix_compat,
    elf_backend_mips_rtype_to_howto,
    elf_backend_ecoff_debug_swap,
Binary files src.orig/bfd/po/es.gmo and src/bfd/po/es.gmo differ
Binary files src.orig/bfd/po/fr.gmo and src/bfd/po/fr.gmo differ
Binary files src.orig/bfd/po/ja.gmo and src/bfd/po/ja.gmo differ
Binary files src.orig/bfd/po/sv.gmo and src/bfd/po/sv.gmo differ
Binary files src.orig/bfd/po/tr.gmo and src/bfd/po/tr.gmo differ
diff -rc3p -N src.orig/bfd/targets.c src/bfd/targets.c
*** src.orig/bfd/targets.c	Thu Apr  4 14:53:38 2002
--- src/bfd/targets.c	Thu Apr  4 16:59:20 2002
*************** extern const bfd_target bfd_elf32_hppa_l
*** 509,514 ****
--- 509,515 ----
  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;
*************** static const bfd_target * const _bfd_tar
*** 759,764 ****
--- 760,766 ----
  	&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,
Binary files src.orig/binutils/po/es.gmo and src/binutils/po/es.gmo differ
Binary files src.orig/binutils/po/fr.gmo and src/binutils/po/fr.gmo differ
Binary files src.orig/binutils/po/ja.gmo and src/binutils/po/ja.gmo differ
Binary files src.orig/binutils/po/tr.gmo and src/binutils/po/tr.gmo differ
diff -rc3p -N src.orig/gas/configure src/gas/configure
*** src.orig/gas/configure	Mon Mar 18 07:46:06 2002
--- src/gas/configure	Tue Apr 16 15:36:05 2002
*************** EOF
*** 2451,2456 ****
--- 2451,2457 ----
        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*)          fmt=elf ;;
        i386-*-*nt*)          fmt=coff em=pe bfd_gas=yes ;;
        i386-*-vxworks*)      fmt=aout ;;
        i386-*-chaos)         fmt=elf ;;
diff -rc3p -N src.orig/gas/configure.in src/gas/configure.in
*** src.orig/gas/configure.in	Mon Mar 18 07:46:09 2002
--- src/gas/configure.in	Tue Apr 16 15:36:21 2002
*************** changequote([,])dnl
*** 298,303 ****
--- 298,304 ----
        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*)          fmt=elf ;;
        i386-*-*nt*)          fmt=coff em=pe bfd_gas=yes ;;
        i386-*-vxworks*)      fmt=aout ;;
        i386-*-chaos)         fmt=elf ;;
Binary files src.orig/gas/po/es.gmo and src/gas/po/es.gmo differ
Binary files src.orig/gas/po/fr.gmo and src/gas/po/fr.gmo differ
Binary files src.orig/gas/po/tr.gmo and src/gas/po/tr.gmo differ
Binary files src.orig/gprof/po/es.gmo and src/gprof/po/es.gmo differ
Binary files src.orig/gprof/po/fr.gmo and src/gprof/po/fr.gmo differ
Binary files src.orig/gprof/po/sv.gmo and src/gprof/po/sv.gmo differ
Binary files src.orig/gprof/po/tr.gmo and src/gprof/po/tr.gmo differ
diff -rc3p -N src.orig/ld/Makefile.in src/ld/Makefile.in
*** src.orig/ld/Makefile.in	Thu Apr  4 09:07:57 2002
--- src/ld/Makefile.in	Thu Apr  4 16:59:35 2002
*************** ez8001.c: $(srcdir)/emulparams/z8001.sh 
*** 1706,1711 ****
--- 1706,1714 ----
  ez8002.c: $(srcdir)/emulparams/z8002.sh \
    $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
  	${GENSCRIPTS} z8002 "$(tdir_z8002)"
+ ei386nto.c: $(srcdir)/emulparams/i386nto.sh \
+   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ 	${GENSCRIPTS} i386nto "$(tdir_i386nto)"
  
  # The generated emulation files mostly have the same dependencies.
  $(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
diff -rc3p -N src.orig/ld/configure.tgt src/ld/configure.tgt
*** src.orig/ld/configure.tgt	Mon Mar 18 11:42:42 2002
--- src/ld/configure.tgt	Thu Mar 21 10:43:28 2002
*************** m68*-ericsson-ose)	targ_emul=sun3 ;;
*** 118,123 ****
--- 118,124 ----
  m68*-apple-aux*)	targ_emul=m68kaux ;;
  *-tandem-none)		targ_emul=st2000 ;;
  i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
+ i[3456]86-*-nto*)	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 ;;
diff -rc3p -N src.orig/ld/emulparams/i386nto.sh src/ld/emulparams/i386nto.sh
*** src.orig/ld/emulparams/i386nto.sh	Wed Dec 31 19:00:00 1969
--- src/ld/emulparams/i386nto.sh	Thu Mar 21 14:25:08 2002
***************
*** 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
diff -rc3p -N src.orig/ld/emultempl/elf32.em src/ld/emultempl/elf32.em
*** src.orig/ld/emultempl/elf32.em	Tue Mar 19 16:03:43 2002
--- src/ld/emultempl/elf32.em	Mon Mar 25 10:45:35 2002
*************** cat >>e${EMULATION_NAME}.c <<EOF
*** 695,702 ****
--- 695,709 ----
  	    {
  	      char *filename;
  
+ 	  #if 0
+ 	      /* This was removed to allow the linker to search in library
+ 	         paths supplied at the command-line when looking for libs that
+ 	         are in DT_NEEDED sections of shared libraries. 
+ 	         GP March 25, 2002 */
+ 
  	      if (search->cmdline)
  		continue;
+ 	  #endif
  	      filename = (char *) xmalloc (strlen (search->name) + len + 2);
  	      sprintf (filename, "%s/%s", search->name, l->name);
  	      if (gld${EMULATION_NAME}_try_needed (filename, force))
Binary files src.orig/ld/po/es.gmo and src/ld/po/es.gmo differ
Binary files src.orig/ld/po/fr.gmo and src/ld/po/fr.gmo differ
Binary files src.orig/ld/po/sv.gmo and src/ld/po/sv.gmo differ
Binary files src.orig/ld/po/tr.gmo and src/ld/po/tr.gmo differ
Binary files src.orig/opcodes/po/da.gmo and src/opcodes/po/da.gmo differ
Binary files src.orig/opcodes/po/de.gmo and src/opcodes/po/de.gmo differ
Binary files src.orig/opcodes/po/es.gmo and src/opcodes/po/es.gmo differ
Binary files src.orig/opcodes/po/fr.gmo and src/opcodes/po/fr.gmo differ
Binary files src.orig/opcodes/po/sv.gmo and src/opcodes/po/sv.gmo differ
Binary files src.orig/opcodes/po/tr.gmo and src/opcodes/po/tr.gmo differ


More information about the Binutils mailing list