diff options
author | Ken Raeburn <raeburn@cygnus> | 1992-06-16 12:04:03 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@cygnus> | 1992-06-16 12:04:03 +0000 |
commit | ce07dd7c0cc9034fd9aac351d34a99b1452c0203 (patch) | |
tree | 1178d85f82390429d19d2f3b233b3bdf72e5b32e /bfd/archures.c | |
parent | 41729eb4b085f5e524678a9c0b4d4a6516ad4e6a (diff) | |
download | gdb-ce07dd7c0cc9034fd9aac351d34a99b1452c0203.zip gdb-ce07dd7c0cc9034fd9aac351d34a99b1452c0203.tar.gz gdb-ce07dd7c0cc9034fd9aac351d34a99b1452c0203.tar.bz2 |
[time to file a PR on cvs...]
Various changes to get linker working again for a.out:
* don't set/adjust section file positions or vmas more than once
* use correct page size and segment size when calculating them
* deal with some variations in a.out implementations
Tested on sun4 and sun4->sun3 so far, will be testing further but
needed to get wider exposure&testing. See ChangeLog for details.
Also:
* coffcode.h (coff_write_relocs): Write out swapped reloc, not
pre-swapped version.
* hosts/sparc.h (abort, exit): Hide these names if compiling with
gcc version 2, to avoid warnings.
Diffstat (limited to 'bfd/archures.c')
-rw-r--r-- | bfd/archures.c | 140 |
1 files changed, 64 insertions, 76 deletions
diff --git a/bfd/archures.c b/bfd/archures.c index ffc1dd2..33063db 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -24,8 +24,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ SECTION Architectures -DESCRIPTION - BFD's idea of an architecture is implimented in <<archures.c>>. BFD keeps one atom in a BFD describing the architecture of the data attached to the BFD; a pointer to a @@ -132,7 +130,8 @@ DESCRIPTION . long mach; . char *arch_name; . CONST char *printable_name; -.{* true if this is the default machine for the architecture *} +. unsigned int section_align_power; +. {* true if this is the default machine for the architecture *} . boolean the_default; . CONST struct bfd_arch_info * EXFUN((*compatible), . (CONST struct bfd_arch_info *a, @@ -141,12 +140,11 @@ DESCRIPTION . boolean EXFUN((*scan),(CONST struct bfd_arch_info *,CONST char *)); . unsigned int EXFUN((*disassemble),(bfd_vma addr, CONST char *data, . PTR stream)); -. CONST struct reloc_howto_struct *EXFUN((*reloc_type_lookup), -. (CONST struct bfd_arch_info *, -. bfd_reloc_code_type code)); . -. struct bfd_arch_info *next; +. unsigned int segment_size; +. unsigned int page_size; . +. struct bfd_arch_info *next; .} bfd_arch_info_type; */ @@ -154,17 +152,16 @@ bfd_arch_info_type *bfd_arch_info_list; /* - FUNCTION bfd_printable_name +SYNOPSIS + CONST char *bfd_printable_name(bfd *abfd); + DESCRIPTION Return a printable string representing the architecture and machine from the pointer to the arch info structure -SYNOPSIS - CONST char *bfd_printable_name(bfd *abfd); - */ CONST char * @@ -180,14 +177,15 @@ DEFUN(bfd_printable_name, (abfd), FUNCTION bfd_scan_arch +SYNOPSIS + bfd_arch_info_type *bfd_scan_arch(CONST char *); + DESCRIPTION This routine is provided with a string and tries to work out if bfd supports any cpu which could be described with the name provided. The routine returns a pointer to an arch_info structure if a machine is found, otherwise NULL. -SYNOPSIS - bfd_arch_info_type *bfd_scan_arch(CONST char *); */ bfd_arch_info_type * @@ -213,19 +211,17 @@ DEFUN(bfd_scan_arch,(string), FUNCTION bfd_arch_get_compatible -DESCRIPTION +SYNOPSIS + CONST bfd_arch_info_type *bfd_arch_get_compatible( + CONST bfd *abfd, + CONST bfd *bbfd); +DESCRIPTION This routine is used to determine whether two BFDs' architectures and achine types are compatible. It calculates the lowest common denominator between the two architectures and machine types implied by the BFDs and returns a pointer to an arch_info structure describing the compatible machine. - - -SYNOPSIS - CONST bfd_arch_info_type *bfd_arch_get_compatible( - CONST bfd *abfd, - CONST bfd *bbfd); */ CONST bfd_arch_info_type * @@ -239,14 +235,15 @@ CONST bfd *bbfd) /* -INTERNAL - -SUBSECTION +INTERNAL_DEFINITION bfd_default_arch_struct DESCRIPTION - What bfds are seeded with - + The <<bfd_default_arch_struct>> is an item of + <<bfd_arch_info_type>> which has been initialized to a fairly + generic state. A BFD starts life by pointing to this + structure, until the correct back end has determined the real + architecture of the file. .extern bfd_arch_info_type bfd_default_arch_struct; @@ -254,12 +251,10 @@ DESCRIPTION bfd_arch_info_type bfd_default_arch_struct = { - 32,32,8,bfd_arch_unknown,0,"unknown","unknown",true, + 32,32,8,bfd_arch_unknown,0,"unknown","unknown",1,true, bfd_default_compatible, bfd_default_scan, 0, - bfd_default_reloc_type_lookup - }; /* @@ -279,20 +274,18 @@ bfd_arch_info_type *arg) } /* -INTERNAL FUNCTION +INTERNAL_FUNCTION bfd_default_set_arch_mach -DESCRIPTION - Set the architecture and machine type in a bfd. This finds the - correct pointer to structure and inserts it into the arch_info - pointer. - - SYNOPSIS boolean bfd_default_set_arch_mach(bfd *abfd, enum bfd_architecture arch, unsigned long mach); +DESCRIPTION + Set the architecture and machine type in a bfd. This finds the + correct pointer to structure and inserts it into the arch_info + pointer. */ boolean DEFUN(bfd_default_set_arch_mach,(abfd, arch, mach), @@ -341,12 +334,13 @@ boolean DEFUN(bfd_default_set_arch_mach,(abfd, arch, mach), FUNCTION bfd_get_arch +SYNOPSIS + enum bfd_architecture bfd_get_arch(bfd *abfd); + DESCRIPTION Returns the enumerated type which describes the supplied bfd's architecture -SYNOPSIS - enum bfd_architecture bfd_get_arch(bfd *abfd); */ enum bfd_architecture DEFUN(bfd_get_arch, (abfd), bfd *abfd) @@ -358,12 +352,12 @@ enum bfd_architecture DEFUN(bfd_get_arch, (abfd), bfd *abfd) FUNCTION bfd_get_mach +SYNOPSIS + unsigned long bfd_get_mach(bfd *abfd); + DESCRIPTION Returns the long type which describes the supplied bfd's machine - -SYNOPSIS - unsigned long bfd_get_mach(bfd *abfd); */ unsigned long @@ -376,11 +370,12 @@ DEFUN(bfd_get_mach, (abfd), bfd *abfd) FUNCTION bfd_arch_bits_per_byte +SYNOPSIS + unsigned int bfd_arch_bits_per_byte(bfd *abfd); + DESCRIPTION Returns the number of bits in one of the architectures bytes -SYNOPSIS - unsigned int bfd_arch_bits_per_byte(bfd *abfd); */ unsigned int DEFUN(bfd_arch_bits_per_byte, (abfd), bfd *abfd) @@ -392,11 +387,11 @@ unsigned int DEFUN(bfd_arch_bits_per_byte, (abfd), bfd *abfd) FUNCTION bfd_arch_bits_per_address -DESCRIPTION - Returns the number of bits in one of the architectures addresses - SYNOPSIS unsigned int bfd_arch_bits_per_address(bfd *abfd); + +DESCRIPTION + Returns the number of bits in one of the architectures addresses */ unsigned int DEFUN(bfd_arch_bits_per_address, (abfd), bfd *abfd) @@ -442,17 +437,16 @@ static void EXFUN((*archures_init_table[]),()) = /* -INTERNAL FUNCTION +INTERNAL_FUNCTION bfd_arch_init +SYNOPSIS + void bfd_arch_init(void); + DESCRIPTION This routine initializes the architecture dispatch table by calling all installed architecture packages and getting them to poke around. - -SYNOPSIS - void bfd_arch_init(void); - */ void @@ -469,15 +463,14 @@ DEFUN_VOID(bfd_arch_init) /* -INTERNAL FUNCTION +INTERNAL_FUNCTION bfd_arch_linkin -DESCRIPTION - Link the provided arch info structure into the list - SYNOPSIS void bfd_arch_linkin(bfd_arch_info_type *); +DESCRIPTION + Link the provided arch info structure into the list */ void DEFUN(bfd_arch_linkin,(ptr), @@ -489,16 +482,16 @@ void DEFUN(bfd_arch_linkin,(ptr), /* -INTERNAL FUNCTION +INTERNAL_FUNCTION bfd_default_compatible -DESCRIPTION - The default function for testing for compatibility. - SYNOPSIS CONST bfd_arch_info_type *bfd_default_compatible (CONST bfd_arch_info_type *a, CONST bfd_arch_info_type *b); + +DESCRIPTION + The default function for testing for compatibility. */ CONST bfd_arch_info_type * @@ -519,16 +512,15 @@ DEFUN(bfd_default_compatible,(a,b), /* -INTERNAL FUNCTION +INTERNAL_FUNCTION bfd_default_scan -DESCRIPTION - The default function for working out whether this is an - architecture hit and a machine hit. - SYNOPSIS boolean bfd_default_scan(CONST struct bfd_arch_info *, CONST char *); +DESCRIPTION + The default function for working out whether this is an + architecture hit and a machine hit. */ boolean @@ -648,21 +640,17 @@ bfd *abfd) FUNCTION bfd_lookup_arch -DESCRIPTION - - Look for the architecure info struct which matches the - arguments given. A machine of 0 will match the - machine/architecture structure which marks itself as the - default. - - SYNOPSIS bfd_arch_info_type *bfd_lookup_arch (enum bfd_architecture arch, long machine); - +DESCRIPTION + Look for the architecure info struct which matches the + arguments given. A machine of 0 will match the + machine/architecture structure which marks itself as the + default. */ bfd_arch_info_type * @@ -690,15 +678,15 @@ long machine) FUNCTION bfd_printable_arch_mach +SYNOPSIS + CONST char * bfd_printable_arch_mach + (enum bfd_architecture arch, unsigned long machine); + DESCRIPTION Return a printable string representing the architecture and machine type. NB. The use of this routine is depreciated. - -SYNOPSIS - CONST char * bfd_printable_arch_mach - (enum bfd_architecture arch, unsigned long machine); */ CONST char * |