diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/Makefile.in | 8 | ||||
-rw-r--r-- | bfd/coff-i960.c | 28 | ||||
-rw-r--r-- | bfd/coff-m68k.c | 6 | ||||
-rw-r--r-- | bfd/coff-m88k.c | 8 | ||||
-rw-r--r-- | bfd/coff-mips.c | 11 | ||||
-rwxr-xr-x | bfd/coffswap.c | 4 | ||||
-rw-r--r-- | bfd/hosts/sparc.h | 47 |
7 files changed, 74 insertions, 38 deletions
diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 22bcb45..462e394 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -37,16 +37,16 @@ CFLAGS = -g $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) # -DINTEL960VERSION BFD_LIBS = libbfd.o opncls.o bfd.o archive.o targets.o cache.o \ archures.o -BFD_BACKENDS = oasys.o ieee.o srec.o aout.o sunos.o icoff.o b.out.o \ - m68kcoff.o m88k-bcs.o coffswap.o ecoff.o newsos3.o # trad-core.o +BFD_BACKENDS = oasys.o ieee.o srec.o aout64.o aout32.o sunos.o icoff.o demo64.o \ + m68kcoff.o m88k-bcs.o coffswap.o ecoff.o newsos3.o # trad-core.o bout.o BFD_H=$(INCDIR)/bfd.h SYSDEP_H=$(INCDIR)/sysdep.h # C source files that correspond to .o's. CFILES = libbfd.c opncls.c bfd.c archive.c targets.c cache.c archures.c \ - aout.c sunos.c icoff.c b.out.c srec.c oasys.c ieee.c m68kcoff.c \ - m88k-bcs.c coffswap.c ecoff.c trad-core.c newsos3.c + aout64.c aout32.c sunos.c demo64.c icoff.c srec.c oasys.c ieee.c m68kcoff.c \ + m88k-bcs.c coffswap.c ecoff.c trad-core.c newsos3.c #bout.c STAGESTUFF = $(TARGETLIB) $(OFILES) diff --git a/bfd/coff-i960.c b/bfd/coff-i960.c index cbbd49e..a0b04be 100644 --- a/bfd/coff-i960.c +++ b/bfd/coff-i960.c @@ -24,7 +24,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define BADMAG(x) I960BADMAG(x) #include <ansidecl.h> -#include "sysdep.h" + #include "bfd.h" #include "libbfd.h" #include "obstack.h" @@ -70,7 +70,7 @@ asection *ignore_input_section; to the correct location */ { union internal_auxent *aux = (union internal_auxent *)(cs->native+2); - int word = bfd_getlong(abfd, data + reloc_entry->address); + int word = bfd_get_32(abfd, data + reloc_entry->address); int olf = (aux->x_bal.x_balntry - cs->native->n_value); BFD_ASSERT(cs->native->n_numaux==2); /* We replace the original call instruction with a bal to */ @@ -80,7 +80,7 @@ asection *ignore_input_section; /* offset of the bal entry point */ word = ((word + olf) & BAL_MASK) | BAL; - bfd_putlong(abfd, word, data+reloc_entry->address); + bfd_put_32(abfd, word, data+reloc_entry->address); } result = bfd_reloc_ok; break; @@ -158,17 +158,17 @@ bfd_target icoff_little_vec = '/', /* ar_pad_char */ 15, /* ar_max_namelen */ - _do_getllong, _do_putllong, _do_getlshort, _do_putlshort, /* data */ - _do_getllong, _do_putllong, _do_getlshort, _do_putlshort, /* hdrs */ + _do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* data */ + _do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, /* bfd_set_format */ + _bfd_generic_mkarchive, bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, JUMP_TABLE(coff) -}; + }; bfd_target icoff_big_vec = @@ -186,8 +186,8 @@ bfd_target icoff_big_vec = '/', /* ar_pad_char */ 15, /* ar_max_namelen */ - _do_getllong, _do_putllong, _do_getlshort, _do_putlshort, /* data */ - _do_getblong, _do_putblong, _do_getbshort, _do_putbshort, /* hdrs */ +_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* data */ +_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, _bfd_dummy_target}, diff --git a/bfd/coff-m68k.c b/bfd/coff-m68k.c index 19bf029..c3ae26e 100644 --- a/bfd/coff-m68k.c +++ b/bfd/coff-m68k.c @@ -41,8 +41,8 @@ static reloc_howto_type howto_table[] = /* Turn a howto into a reloc nunmber */ -#define SELECT_RELOC(x,howto) { x = howto_table[howto->size +howto->pc_relative*3].type; } +#define SELECT_RELOC(x,howto) { x = howto_table[howto->size +(int)howto->pc_relative*3].type; } #define BADMAG(x) M68KBADMAG(x) #include "coff-code.h" @@ -65,8 +65,8 @@ bfd_target m68kcoff_vec = '/', /* ar_pad_char */ 15, /* ar_max_namelen */ - _do_getblong, _do_putblong, _do_getbshort, _do_putbshort, /* data */ - _do_getblong, _do_putblong, _do_getbshort, _do_putbshort, /* hdrs */ +_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* data */ +_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, _bfd_dummy_target}, diff --git a/bfd/coff-m88k.c b/bfd/coff-m88k.c index cdb79088..71a4497 100644 --- a/bfd/coff-m88k.c +++ b/bfd/coff-m88k.c @@ -57,13 +57,13 @@ asection *ignore_input_section) { long relocation; bfd_vma addr = reloc_entry->address; - long x = bfd_getshort(abfd, (bfd_byte *)data + addr); + long x = bfd_get_16(abfd, (bfd_byte *)data + addr); HOWTO_PREPARE(relocation, symbol_in); x = (x + relocation + reloc_entry->addend) >> 16; - bfd_putshort(abfd, x, (bfd_byte *)data + addr); + bfd_put_16(abfd, x, (bfd_byte *)data + addr); return bfd_reloc_ok; } @@ -105,8 +105,8 @@ bfd_target m88k_bcs_vec = '/', /* ar_pad_char */ 15, /* ar_max_namelen */ - _do_getblong, _do_putblong, _do_getbshort, _do_putbshort, /* data */ - _do_getblong, _do_putblong, _do_getbshort, _do_putbshort, /* hdrs */ +_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* data */ +_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, _bfd_dummy_target}, diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index effbac4..362be56 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -29,7 +29,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "bfd.h" #include "libbfd.h" -#include "sysdep.h" + #include "intel-coff.h" #include "libcoff.h" /* to allow easier abstraction-breaking */ @@ -50,8 +50,8 @@ bfd_target ecoff_little_vec = (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* sect flags */ '/', /* ar_pad_char */ 15, /* ar_max_namelen */ - _do_getllong, _do_putllong, _do_getlshort, _do_putlshort, /* data */ - _do_getllong, _do_putllong, _do_getlshort, _do_putlshort, /* hdrs */ +_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* data */ +_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* hdrs */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, _bfd_dummy_target}, @@ -74,9 +74,8 @@ bfd_target ecoff_big_vec = (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* sect flags */ ' ', /* ar_pad_char */ 16, /* ar_max_namelen */ - _do_getblong, _do_putblong, _do_getbshort, _do_putbshort, /* data */ - _do_getblong, _do_putblong, _do_getbshort, _do_putbshort, /* hdrs */ - +_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* data */ +_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, _bfd_dummy_target}, {bfd_false, coff_mkobject, bfd_false, /* bfd_set_format */ diff --git a/bfd/coffswap.c b/bfd/coffswap.c index 78aea53..b1f7451 100755 --- a/bfd/coffswap.c +++ b/bfd/coffswap.c @@ -19,14 +19,14 @@ You should have received a copy of the GNU General Public License along with */ /* Most of this hacked by Steve Chamberlain, steve@cygnus.com */ - +#if 0 #include <ansidecl.h> #include "intel-coff.h" #include "bfd.h" #include "libcoff.h" /* to allow easier abstraction-breaking */ #define sp(x) bfd_h_put_x(abfd, x, &x) -#if 0 + /* All the generic swapping routines: FIXME diff --git a/bfd/hosts/sparc.h b/bfd/hosts/sparc.h index 376aad6..a4652a2 100644 --- a/bfd/hosts/sparc.h +++ b/bfd/hosts/sparc.h @@ -17,14 +17,14 @@ extern PROTO(int, close,(int)); extern PROTO(int, fcntl,(int des, int cmd)); extern PROTO(int, fprintf,(FILE *,char *,...)); extern PROTO(int, printf,(char *,...)); -extern PROTO(int, oqsort,(void *data,int els, int siz, int func())); +extern PROTO(int, qsort,(void *data,int els, int siz, int func())); extern PROTO(void, exit,(int)); extern PROTO(int, fseek,(FILE*, int, int)); extern PROTO(int, fclose,(FILE*)); extern PROTO(void, bcopy,(char*,char*,int)); extern PROTO(int, bcmp,(char *, char *, int)); extern PROTO(void, bzero,(char *, int)); -extern PROTO(char *,memset,(char*, int, int)); +extern PROTO(PTR,memset,(PTR, int,unsigned int)); PROTO(PTR, memcpy,(PTR,CONST PTR,unsigned int)); extern char * strchr(); extern PROTO(void, perror,(char *)); @@ -38,9 +38,13 @@ extern int fwrite(); extern int sscanf(); extern int stat(); extern int strtol(); -void free(); -char *malloc(); -char *realloc(); +#ifndef DONTDECLARE_MALLOC +extern PROTO(PTR,malloc,(unsigned)); +extern PROTO(PTR ,realloc, (PTR, unsigned)); +#endif + +extern PROTO(int, free,(PTR)); + PROTO (void, perror, (char *s)); extern char *strrchr(); extern char *ctime(); @@ -63,6 +67,16 @@ typedef unsigned short uint16e_type; typedef int int32e_type; typedef unsigned int uint32e_type; + +#ifdef __GNUC__ +typedef unsigned long long uint64e_type; + +#else +typedef struct { + uint32e_type low, high; +} uint64e_type; + +#endif /* CORRECT SIZE OR GREATER */ typedef char int8_type; typedef unsigned char uint8_type; @@ -71,3 +85,26 @@ typedef unsigned short uint16_type; typedef int int32_type; typedef unsigned int uint32_type; +#ifdef __GNUC__ +typedef unsigned long long uint64_type; +typedef long long int64_type; +#else +typedef struct { + uint32e_type low, high; +} uint64_type; + +typedef struct { + uint32e_type low, high; +} int64_type; + +#endif + + +#define BYTES_IN_PRINTF_INT 4 +#ifndef __GNUC__ +#define uint64_typeLOW(x) (uint32_type)(((x).low)) +#define uint64_typeHIGH(x) (uint32_type)(((x).high)) +#else +#define uint64_typeLOW(x) (uint32_type)(((x) & 0xffffffff)) +#define uint64_typeHIGH(x) (uint32_type)(((x) >> 32) & 0xffffffff) +#endif |