diff options
author | Nick Clifton <nickc@redhat.com> | 1999-07-19 14:55:16 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 1999-07-19 14:55:16 +0000 |
commit | c3c89269f8afef30bf467225f538d56daf57e245 (patch) | |
tree | 203ceab6adb9b30d0831d3eaeeecfb2fd875115f /bfd/coff-arm.c | |
parent | a9602746fa290e999d3df58bb9281f80340bf5ac (diff) | |
download | gdb-c3c89269f8afef30bf467225f538d56daf57e245.zip gdb-c3c89269f8afef30bf467225f538d56daf57e245.tar.gz gdb-c3c89269f8afef30bf467225f538d56daf57e245.tar.bz2 |
Add new field to bfd_target structure.
Initialise this field for all known bfd targets.
Add new search function to targets.c
Diffstat (limited to 'bfd/coff-arm.c')
-rw-r--r-- | bfd/coff-arm.c | 133 |
1 files changed, 19 insertions, 114 deletions
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c index 250373d..2af1a94 100644 --- a/bfd/coff-arm.c +++ b/bfd/coff-arm.c @@ -2428,128 +2428,33 @@ arm_bfd_coff_swap_sym_in (abfd, ext1, in1) #include "coffcode.h" -const bfd_target -#ifdef TARGET_LITTLE_SYM -TARGET_LITTLE_SYM = -#else -armcoff_little_vec = +#ifndef TARGET_LITTLE_SYM +#define TARGET_LITTLE_SYM armcoff_little_vec #endif -{ -#ifdef TARGET_LITTLE_NAME - TARGET_LITTLE_NAME, -#else - "coff-arm-little", +#ifndef TARGET_LITTLE_NAME +#define TARGET_LITTLE_NAME "coff-arm-little" #endif - bfd_target_coff_flavour, - BFD_ENDIAN_LITTLE, /* data byte order is little */ - BFD_ENDIAN_LITTLE, /* header byte order is little */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), - -#ifndef COFF_WITH_PE - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ -#else - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */ - | SEC_LINK_ONCE | SEC_LINK_DUPLICATES), +#ifndef TARGET_BIG_SYM +#define TARGET_BIG_SYM armcoff_big_vec #endif - -#ifdef TARGET_UNDERSCORE - TARGET_UNDERSCORE, /* leading underscore */ -#else - 0, /* leading underscore */ +#ifndef TARGET_BIG_NAME +#define TARGET_BIG_NAME "coff-arm-big" #endif - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - -/* Note that we allow an object file to be treated as a core file as well. */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, coff_object_p}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - (PTR) & bfd_coff_std_swap_table, -}; -const bfd_target -#ifdef TARGET_BIG_SYM -TARGET_BIG_SYM = -#else -armcoff_big_vec = +#ifndef TARGET_UNDERSCORE +#define TARGET_UNDERSCORE 0 #endif -{ -#ifdef TARGET_BIG_NAME - TARGET_BIG_NAME, + +#ifdef COFF_WITH_PE +#define EXTRA_S_FLAGS (SEC_LINK_ONCE | SEC_LINK_DUPLICATES) #else - "coff-arm-big", +#define EXTRA_S_FLAGS 0 #endif - bfd_target_coff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_BIG, /* header byte order is big */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), +/* Forward declaration for use initialising alternative_target field. */ +extern const bfd_target TARGET_BIG_SYM ; -#ifndef COFF_WITH_PE - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ -#else - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */ - | SEC_LINK_ONCE | SEC_LINK_DUPLICATES), -#endif +/* Target vectors. */ +CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_BIG_SYM) +CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_LITTLE_SYM) -#ifdef TARGET_UNDERSCORE - TARGET_UNDERSCORE, /* leading underscore */ -#else - 0, /* leading underscore */ -#endif - '/', /* ar_pad_char */ - 15, /* ar_max_namelen */ - - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - -/* Note that we allow an object file to be treated as a core file as well. */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, coff_object_p}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - (PTR) & bfd_coff_std_swap_table, -}; |