2.13.1pre1 available

Graeme Peterson gp@qnx.com
Thu Oct 31 13:54:00 GMT 2002


Here is a patch that cleans up the 2.13pre1 support for i386qnx.

I am quite happy to leave it at this, and wait for the support in 
the development branch to propogate, if that works for you.

Regards, and thanks.
GP


bfd/ChangeLog entry:
====================


2002-10-31  Graeme Peterson  <gp@qnx.com>

	* Makefile.am: Removed entries for elf32-i386qnx.c and
	elf32-i386qnx.lo.
	* Makefile.in: Regenerate.
	* config.bfd: Changed i[3456]86-*-nto-qnx* targ_defvec from
	bfd_elf32_i386qnx_vec to bfd_elf32_i386_vec.
	* configure.in: Removed support for bfd_elf32_i386qnx_vec.
	* configure: Regenerate.
	* elf32-i386qnx.c: Removed.
	* elf.c: Removed calls to QNX specific set_nonloadable_filepos,
	is_contained_by_filepos, and copy_private_bfd_data_p.
	* elf32-i386.c: Removed QNX specific #ifdef ELF32_I386_C_INCLUDED.
        * targets.c: Removed bfd_elf32_i386qnx_vec.
	* elfxx-target.h: Removed QNX specific elf_backend_set_nonloadable_filepos,
	elf_backend_is_contained_by_filepos, and elf_backend_copy_private_bfd_data_p.
	* elf-bfd.h: Removed QNX specific set_nonloadable_filepos,
	is_contained_by_filepos, and copy_private_bfd_data_p.


-------------- next part --------------
diff -rc3p -N -x .#* -x CVS -x Makefile.in -x configure src.orig/bfd/Makefile.am src/bfd/Makefile.am
*** src.orig/bfd/Makefile.am	Wed Oct 30 10:26:03 2002
--- src/bfd/Makefile.am	Thu Oct 31 16:20:58 2002
*************** BFD32_BACKENDS = \
*** 211,217 ****
  	elf32-i370.lo \
  	elf32-i386.lo \
  	elf32-i386-fbsd.lo \
- 	elf32-i386qnx.lo \
  	elf32-i860.lo \
  	elf32-i960.lo \
  	elf32-ia64.lo \
--- 211,216 ----
*************** BFD32_BACKENDS_CFILES = \
*** 369,375 ****
  	elf32-i370.c \
  	elf32-i386.c \
  	elf32-i386-fbsd.c \
- 	elf32-i386qnx.c \
  	elf32-i860.c \
  	elf32-i960.c \
  	elf32-m32r.c \
--- 368,373 ----
*************** elf32-i386.lo: elf32-i386.c $(INCDIR)/fi
*** 1142,1151 ****
    $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \
    elf32-target.h
  elf32-i386-fbsd.lo: elf32-i386-fbsd.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-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
--- 1140,1145 ----
diff -rc3p -N -x .#* -x CVS -x Makefile.in -x configure src.orig/bfd/config.bfd src/bfd/config.bfd
*** src.orig/bfd/config.bfd	Mon Oct 28 10:58:12 2002
--- src/bfd/config.bfd	Thu Oct 31 16:21:28 2002
*************** case "${targ}" in
*** 360,366 ****
      targ_selvecs=i386coff_vec
      ;;
    i[3456]86-*-nto-qnx*)
!     targ_defvec=bfd_elf32_i386qnx_vec
      targ_selvecs=i386coff_vec
      ;;
    i[3456]86-*-chorus*)
--- 360,366 ----
      targ_selvecs=i386coff_vec
      ;;
    i[3456]86-*-nto-qnx*)
!     targ_defvec=bfd_elf32_i386_vec
      targ_selvecs=i386coff_vec
      ;;
    i[3456]86-*-chorus*)
diff -rc3p -N -x .#* -x CVS -x Makefile.in -x configure src.orig/bfd/configure.in src/bfd/configure.in
*** src.orig/bfd/configure.in	Mon Sep 23 15:11:17 2002
--- src/bfd/configure.in	Thu Oct 31 16:21:39 2002
*************** do
*** 577,583 ****
      bfd_elf32_i370_vec)		tb="$tb elf32-i370.lo elf32.lo $elf" ;;
      bfd_elf32_i386_freebsd_vec)	tb="$tb elf32-i386-fbsd.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" ;;
--- 577,582 ----
diff -rc3p -N -x .#* -x CVS -x Makefile.in -x configure src.orig/bfd/elf-bfd.h src/bfd/elf-bfd.h
*** src.orig/bfd/elf-bfd.h	Tue Sep 17 09:43:05 2002
--- src/bfd/elf-bfd.h	Thu Oct 31 16:43:05 2002
*************** struct elf_backend_data
*** 770,791 ****
    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)
--- 770,775 ----
diff -rc3p -N -x .#* -x CVS -x Makefile.in -x configure src.orig/bfd/elf.c src/bfd/elf.c
*** src.orig/bfd/elf.c	Fri Oct 11 09:23:08 2002
--- src/bfd/elf.c	Thu Oct 31 16:28:09 2002
*************** Error: First section in segment (%s) sta
*** 3960,3970 ****
  	}
      }
  
-   /* 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++)
      {
--- 3960,3965 ----
*************** copy_private_bfd_data (ibfd, obfd)
*** 4560,4572 ****
     && (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							\
--- 4555,4560 ----
*************** copy_private_bfd_data (ibfd, obfd)
*** 4602,4610 ****
        ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr)	\
        : IS_CONTAINED_BY_VMA (section, segment))				\
       && (section->flags & SEC_ALLOC) != 0)				\
!     || IS_COREFILE_NOTE (segment, section)				\
!     || (IS_CONTAINED_BY_FILEPOS (section, segment, bed)			\
!         && (section->flags & SEC_ALLOC) == 0))				\
     && section->output_section != NULL					\
     && ! section->segment_mark)
  
--- 4590,4596 ----
        ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr)	\
        : IS_CONTAINED_BY_VMA (section, segment))				\
       && (section->flags & SEC_ALLOC) != 0)				\
!     || IS_COREFILE_NOTE (segment, section))				\
     && section->output_section != NULL					\
     && ! section->segment_mark)
  
*************** copy_private_bfd_data (ibfd, obfd)
*** 4849,4855 ****
  	      /* 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)
  		  || (bed->want_p_paddr_set_to_zero &&
  		      IS_CONTAINED_BY_VMA (output_section, segment))
--- 4835,4840 ----
*************** copy_private_bfd_data (ibfd, obfd)
*** 5086,5092 ****
  #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
--- 5071,5076 ----
*************** _bfd_elf_copy_private_section_data (ibfd
*** 5112,5131 ****
        || obfd->xvec->flavour != bfd_target_elf_flavour)
      return true;
  
!   /* Copy over private BFD data if it has not already been copied.
!      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.  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;
  
--- 5096,5102 ----
        || obfd->xvec->flavour != bfd_target_elf_flavour)
      return true;
  
!   if (elf_tdata (obfd)->segment_map == NULL && elf_tdata (ibfd)->phdr != NULL)
      {
  	asection *s;
  
diff -rc3p -N -x .#* -x CVS -x Makefile.in -x configure src.orig/bfd/elf32-i386.c src/bfd/elf32-i386.c
*** src.orig/bfd/elf32-i386.c	Mon Oct 28 10:10:59 2002
--- src/bfd/elf32-i386.c	Thu Oct 31 16:38:08 2002
*************** elf_i386_finish_dynamic_sections (output
*** 3388,3393 ****
  #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
--- 3388,3391 ----
diff -rc3p -N -x .#* -x CVS -x Makefile.in -x configure src.orig/bfd/elf32-i386qnx.c src/bfd/elf32-i386qnx.c
*** src.orig/bfd/elf32-i386qnx.c	Mon Oct 28 10:55:38 2002
--- src/bfd/elf32-i386qnx.c	Wed Dec 31 19:00:00 1969
***************
*** 1,113 ****
- /* 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
- #undef  TARGET_LITTLE_NAME
- #define TARGET_LITTLE_NAME		"elf32-i386-nto"
- 
- #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"
--- 0 ----
diff -rc3p -N -x .#* -x CVS -x Makefile.in -x configure src.orig/bfd/elfxx-target.h src/bfd/elfxx-target.h
*** src.orig/bfd/elfxx-target.h	Tue Jul 23 15:37:18 2002
--- src/bfd/elfxx-target.h	Thu Oct 31 16:43:20 2002
*************** Foundation, Inc., 59 Temple Place - Suit
*** 385,399 ****
  #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
--- 385,390 ----
diff -rc3p -N -x .#* -x CVS -x Makefile.in -x configure src.orig/bfd/targets.c src/bfd/targets.c
*** src.orig/bfd/targets.c	Mon Oct 28 11:01:19 2002
--- src/bfd/targets.c	Thu Oct 31 16:20:26 2002
*************** extern const bfd_target bfd_elf32_hppa_v
*** 521,527 ****
  extern const bfd_target bfd_elf32_i370_vec;
  extern const bfd_target bfd_elf32_i386_freebsd_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;
--- 521,526 ----
*************** static const bfd_target * const _bfd_tar
*** 785,791 ****
  	&bfd_elf32_i370_vec,
  	&bfd_elf32_i386_freebsd_vec,
  	&bfd_elf32_i386_vec,
- 	&bfd_elf32_i386qnx_vec,
  	&bfd_elf32_i860_little_vec,
  	&bfd_elf32_i860_vec,
  	&bfd_elf32_i960_vec,
--- 784,789 ----


More information about the Binutils mailing list