Patch to use #ifdef CHOOSE_RELOC_SIZE in aout-target.h

Hans-Peter Nilsson hans-peter.nilsson@axis.com
Tue Feb 29 15:23:00 GMT 2000


> Date: 29 Feb 2000 17:52:51 -0500
> From: Ian Lance Taylor <ian@zembu.com>

> I think we should just get rid of CHOOSE_RELOC_SIZE.  As you say,
> nothing uses it.  The current code uses different mechanisms to set
> the size of relocations, mostly by hooking off of set_arch_mach and
> defining a special write_object_contents routine.

Ok.  I'm trying to clean up old workarounds in my port by
instead fixing and using the generic functions as you might guess.
Here goes nothing:

Wed Mar  1 00:13:56 2000  Hans-Peter Nilsson  <hp@axis.com>

	* aout-target.h (MY(write_object_contents)): Remove unused
	and unusable "#if CHOOSE_RELOC_SIZE".
	* pc532-mach.c (MY(write_object_contents)): Ditto.
	* netbsd.h (MY(write_object_contents)): Ditto.
	* hp300hpux.c (MY(write_object_contents)): Ditto.
	* freebsd.h (MY(write_object_contents)): Ditto.
	* aout-tic30.c (tic30_aout_write_object_contents): Ditto.

Index: aout-target.h
===================================================================
RCS file: /cvs/src/src/bfd/aout-target.h,v
retrieving revision 1.5
diff -p -c -r1.5 aout-target.h
*** aout-target.h	1999/12/10 18:51:34	1.5
--- aout-target.h	2000/02/29 23:19:24
***************
*** 1,5 ****
  /* Define a target vector and some small routines for a variant of a.out.
!    Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
     Free Software Foundation, Inc.
  
  This file is part of BFD, the Binary File Descriptor library.
--- 1,5 ----
  /* Define a target vector and some small routines for a variant of a.out.
!    Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999, 2000
     Free Software Foundation, Inc.
  
  This file is part of BFD, the Binary File Descriptor library.
*************** MY(write_object_contents) (abfd)
*** 258,268 ****
    struct external_exec exec_bytes;
    struct internal_exec *execp = exec_hdr (abfd);
  
- #if CHOOSE_RELOC_SIZE
-   CHOOSE_RELOC_SIZE(abfd);
- #else
    obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
- #endif
  
    WRITE_HEADERS(abfd, execp);
  
--- 258,264 ----
Index: aout-tic30.c
===================================================================
RCS file: /cvs/src/src/bfd/aout-tic30.c,v
retrieving revision 1.5
diff -p -c -r1.5 aout-tic30.c
*** aout-tic30.c	1999/12/10 18:51:34	1.5
--- aout-tic30.c	2000/02/29 23:19:29
***************
*** 1,5 ****
  /* BFD back-end for TMS320C30 a.out binaries.
!    Copyright (C) 1998, 1999 Free Software Foundation, Inc.
     Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
  
     This file is part of BFD, the Binary File Descriptor library.
--- 1,5 ----
  /* BFD back-end for TMS320C30 a.out binaries.
!    Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
     Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
  
     This file is part of BFD, the Binary File Descriptor library.
*************** tic30_aout_write_object_contents (abfd)
*** 610,620 ****
    struct external_exec exec_bytes;
    struct internal_exec *execp = exec_hdr (abfd);
  
- #if CHOOSE_RELOC_SIZE
-   CHOOSE_RELOC_SIZE (abfd);
- #else
    obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
! #endif
    {
      bfd_size_type text_size;	/* dummy vars */
      file_ptr text_end;
--- 610,617 ----
    struct external_exec exec_bytes;
    struct internal_exec *execp = exec_hdr (abfd);
  
    obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
! 
    {
      bfd_size_type text_size;	/* dummy vars */
      file_ptr text_end;
Index: freebsd.h
===================================================================
RCS file: /cvs/src/src/bfd/freebsd.h,v
retrieving revision 1.1.1.1
diff -p -c -r1.1.1.1 freebsd.h
*** freebsd.h	1999/05/03 07:28:57	1.1.1.1
--- freebsd.h	2000/02/29 23:19:31
***************
*** 1,5 ****
  /* BFD back-end definitions used by all FreeBSD targets.
!    Copyright (C) 1990, 1991, 1992, 1996 Free Software Foundation, Inc.
  
  This file is part of BFD, the Binary File Descriptor library.
  
--- 1,5 ----
  /* BFD back-end definitions used by all FreeBSD targets.
!    Copyright (C) 1990, 1991, 1992, 1996, 2000 Free Software Foundation, Inc.
  
  This file is part of BFD, the Binary File Descriptor library.
  
*************** MY(write_object_contents) (abfd)
*** 76,86 ****
    struct external_exec exec_bytes;
    struct internal_exec *execp = exec_hdr (abfd);
  
- #if CHOOSE_RELOC_SIZE
-   CHOOSE_RELOC_SIZE(abfd);
- #else
    obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
- #endif
  
    /* Magic number, maestro, please!  */
    switch (bfd_get_arch(abfd)) {
--- 76,82 ----
Index: hp300hpux.c
===================================================================
RCS file: /cvs/src/src/bfd/hp300hpux.c,v
retrieving revision 1.2
diff -p -c -r1.2 hp300hpux.c
*** hp300hpux.c	1999/07/12 10:29:39	1.2
--- hp300hpux.c	2000/02/29 23:19:38
***************
*** 1,5 ****
  /* BFD backend for hp-ux 9000/300
!    Copyright (C) 1990, 91, 94, 95, 97, 1999 Free Software Foundation, Inc.
     Written by Glenn Engel.
  
  This file is part of BFD, the Binary File Descriptor library.
--- 1,5 ----
  /* BFD backend for hp-ux 9000/300
!    Copyright (C) 1990, 91, 94, 95, 97, 1999, 2000 Free Software Foundation, Inc.
     Written by Glenn Engel.
  
  This file is part of BFD, the Binary File Descriptor library.
*************** MY (write_object_contents) (abfd)
*** 270,280 ****
    file_ptr text_end;
  
    memset (&exec_bytes, 0, sizeof (exec_bytes));
! #if CHOOSE_RELOC_SIZE
!   CHOOSE_RELOC_SIZE (abfd);
! #else
    obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
- #endif
  
    if (adata (abfd).magic == undecided_magic)
      NAME (aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end);
--- 270,277 ----
    file_ptr text_end;
  
    memset (&exec_bytes, 0, sizeof (exec_bytes));
! 
    obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
  
    if (adata (abfd).magic == undecided_magic)
      NAME (aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end);
Index: netbsd.h
===================================================================
RCS file: /cvs/src/src/bfd/netbsd.h,v
retrieving revision 1.1.1.1
diff -p -c -r1.1.1.1 netbsd.h
*** netbsd.h	1999/05/03 07:28:57	1.1.1.1
--- netbsd.h	2000/02/29 23:19:38
***************
*** 1,5 ****
  /* BFD back-end definitions used by all NetBSD targets.
!    Copyright (C) 1990, 91, 92, 94, 95, 96, 97, 1998
     Free Software Foundation, Inc.
  
  This file is part of BFD, the Binary File Descriptor library.
--- 1,5 ----
  /* BFD back-end definitions used by all NetBSD targets.
!    Copyright (C) 1990, 91, 92, 94, 95, 96, 97, 1998, 2000
     Free Software Foundation, Inc.
  
  This file is part of BFD, the Binary File Descriptor library.
*************** MY(write_object_contents) (abfd)
*** 91,101 ****
        NAME(aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end);
      }
  
- #if CHOOSE_RELOC_SIZE
-   CHOOSE_RELOC_SIZE(abfd);
- #else
    obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
- #endif
  
    /* Magic number, maestro, please!  */
    switch (bfd_get_arch(abfd)) {
--- 91,97 ----
Index: pc532-mach.c
===================================================================
RCS file: /cvs/src/src/bfd/pc532-mach.c,v
retrieving revision 1.1.1.1
diff -p -c -r1.1.1.1 pc532-mach.c
*** pc532-mach.c	1999/05/03 07:28:58	1.1.1.1
--- pc532-mach.c	2000/02/29 23:19:39
***************
*** 1,5 ****
  /* BFD back-end for Mach3/532 a.out-ish binaries.
!    Copyright (C) 1990, 1991, 1992, 1994 Free Software Foundation, Inc.
  
  This file is part of BFD, the Binary File Descriptor library.
  
--- 1,5 ----
  /* BFD back-end for Mach3/532 a.out-ish binaries.
!    Copyright (C) 1990, 1991, 1992, 1994, 2000 Free Software Foundation, Inc.
  
  This file is part of BFD, the Binary File Descriptor library.
  
*************** bfd *abfd;
*** 92,102 ****
    struct external_exec exec_bytes;
    struct internal_exec *execp = exec_hdr (abfd);
    
- #if CHOOSE_RELOC_SIZE
-   CHOOSE_RELOC_SIZE(abfd);
- #else
    obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
- #endif
    
    BFD_ASSERT (bfd_get_arch (abfd) == bfd_arch_ns32k);
    switch (bfd_get_mach (abfd))
--- 92,98 ----

brgds, H-P


More information about the Binutils mailing list