* bfd-in2.h: Regenerate.
* coffgen.c (coff_count_linenumbers, coff_symbol_from,
coff_find_nearest_line): Check COFFness using bfd_family_coff()
instead of bfd_target_coff_flavour.
* cofflink.c (_bfd_coff_final_link): Likewise.
* cpu-ns32k.c (do_ns32k_reloc): Don't strcmp() target name to
exclude XCOFF files.
* reloc.c (bfd_perform_relocation, bfd_install_relocation):
Likewise.
* targets.c (enum bfd_flavour): Add bfd_target_xcoff_flavour.
* xcoff-target.h (TARGET_SYM): Use bfd_target_xcoff_flavour.
* xcofflink.c (XCOFF_XVECP): Delete.
(bfd_xcoff_link_record_set, bfd_xcoff_import_symbol,
bfd_xcoff_export_symbol, bfd_xcoff_link_count_reloc,
bfd_xcoff_record_link_assignment,
bfd_xcoff_size_dynamic_sections): Replace XCOFF_XVECP() with
check for bfd_target_xcoff_flavour.
+2000-06-16 Nicholas Duffek <nsd@redhat.com>
+
+ * bfd-in.h (bfd_family_coff): Define.
+ * bfd-in2.h: Regenerate.
+ * coffgen.c (coff_count_linenumbers, coff_symbol_from,
+ coff_find_nearest_line): Check COFFness using bfd_family_coff()
+ instead of bfd_target_coff_flavour.
+ * cofflink.c (_bfd_coff_final_link): Likewise.
+ * cpu-ns32k.c (do_ns32k_reloc): Don't strcmp() target name to
+ exclude XCOFF files.
+ * reloc.c (bfd_perform_relocation, bfd_install_relocation):
+ Likewise.
+ * targets.c (enum bfd_flavour): Add bfd_target_xcoff_flavour.
+ * xcoff-target.h (TARGET_SYM): Use bfd_target_xcoff_flavour.
+ * xcofflink.c (XCOFF_XVECP): Delete.
+ (bfd_xcoff_link_record_set, bfd_xcoff_import_symbol,
+ bfd_xcoff_export_symbol, bfd_xcoff_link_count_reloc,
+ bfd_xcoff_record_link_assignment,
+ bfd_xcoff_size_dynamic_sections): Replace XCOFF_XVECP() with
+ check for bfd_target_xcoff_flavour.
+
2000-06-16 Nicholas Duffek <nsd@redhat.com>
* rs6000-core.c: Support 64-bit core files, support pre-4.3 core
#define bfd_get_format(abfd) ((abfd)->format)
#define bfd_get_target(abfd) ((abfd)->xvec->name)
#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
+#define bfd_family_coff(abfd) \
+ (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
+ bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
#define bfd_header_big_endian(abfd) \
#define bfd_get_format(abfd) ((abfd)->format)
#define bfd_get_target(abfd) ((abfd)->xvec->name)
#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
+#define bfd_family_coff(abfd) \
+ (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
+ bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
#define bfd_header_big_endian(abfd) \
bfd_target_aout_flavour,
bfd_target_coff_flavour,
bfd_target_ecoff_flavour,
+ bfd_target_xcoff_flavour,
bfd_target_elf_flavour,
bfd_target_ieee_flavour,
bfd_target_nlm_flavour,
{
asymbol *q_maybe = *p;
- if (bfd_asymbol_flavour (q_maybe) == bfd_target_coff_flavour)
+ if (bfd_family_coff (bfd_asymbol_bfd (q_maybe)))
{
coff_symbol_type *q = coffsymbol (q_maybe);
bfd *ignore_abfd ATTRIBUTE_UNUSED;
asymbol *symbol;
{
- if (bfd_asymbol_flavour (symbol) != bfd_target_coff_flavour)
+ if (!bfd_family_coff (bfd_asymbol_bfd (symbol)))
return (coff_symbol_type *) NULL;
if (bfd_asymbol_bfd (symbol)->tdata.coff_obj_data == (coff_data_type *) NULL)
*line_ptr = 0;
/* Don't try and find line numbers in a non coff file */
- if (abfd->xvec->flavour != bfd_target_coff_flavour)
+ if (!bfd_family_coff (abfd))
return false;
if (cof == NULL)
for (p = o->link_order_head; p != NULL; p = p->next)
{
if (p->type == bfd_indirect_link_order
- && (bfd_get_flavour (p->u.indirect.section->owner)
- == bfd_target_coff_flavour))
+ && bfd_family_coff (p->u.indirect.section->owner))
{
sub = p->u.indirect.section->owner;
if (! bfd_coff_link_output_has_begun (sub, & finfo))
reloc_entry->address += input_section->output_offset;
/* WTF?? */
- if (abfd->xvec->flavour == bfd_target_coff_flavour
- && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0)
+ if (abfd->xvec->flavour == bfd_target_coff_flavour)
{
#if 1
/* For m68k-coff, the addend was being subtracted twice during
/* WTF?? */
if (abfd->xvec->flavour == bfd_target_coff_flavour
- && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0
- && strcmp (abfd->xvec->name, "aixcoff64-rs6000") != 0
- && strcmp (abfd->xvec->name, "xcoff-powermac") != 0
&& strcmp (abfd->xvec->name, "coff-Intel-little") != 0
&& strcmp (abfd->xvec->name, "coff-Intel-big") != 0)
{
/* WTF?? */
if (abfd->xvec->flavour == bfd_target_coff_flavour
- && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0
- && strcmp (abfd->xvec->name, "aixcoff64-rs6000") != 0
- && strcmp (abfd->xvec->name, "xcoff-powermac") != 0
&& strcmp (abfd->xvec->name, "coff-Intel-little") != 0
&& strcmp (abfd->xvec->name, "coff-Intel-big") != 0)
{
. bfd_target_aout_flavour,
. bfd_target_coff_flavour,
. bfd_target_ecoff_flavour,
+. bfd_target_xcoff_flavour,
. bfd_target_elf_flavour,
. bfd_target_ieee_flavour,
. bfd_target_nlm_flavour,
const bfd_target TARGET_SYM =
{
TARGET_NAME,
- bfd_target_coff_flavour,
+ bfd_target_xcoff_flavour,
BFD_ENDIAN_BIG, /* data byte order is big */
BFD_ENDIAN_BIG, /* header byte order is big */
#define STRING_SIZE_SIZE (4)
-/* In order to support linking different object file formats into an
- XCOFF format, we need to be able to determine whether a particular
- bfd_target is an XCOFF vector. FIXME: We need to rethink this
- whole approach. */
-#define XCOFF_XVECP(xv) \
- (strcmp ((xv)->name, "aixcoff-rs6000") == 0 \
- || strcmp ((xv)->name, "aixcoff64-rs6000") == 0 \
- || strcmp ((xv)->name, "xcoff-powermac") == 0)
-
/* Get the XCOFF hash table entries for a BFD. */
#define obj_xcoff_sym_hashes(bfd) \
((struct xcoff_link_hash_entry **) obj_coff_sym_hashes (bfd))
struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg;
struct xcoff_link_size_list *n;
- if (! XCOFF_XVECP (output_bfd->xvec))
+ if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour)
return true;
/* This will hardly ever be called. I don't want to burn four bytes
{
struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg;
- if (! XCOFF_XVECP (output_bfd->xvec))
+ if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour)
return true;
/* A symbol name which starts with a period is the code for a
{
struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg;
- if (! XCOFF_XVECP (output_bfd->xvec))
+ if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour)
return true;
h->flags |= XCOFF_EXPORT;
{
struct xcoff_link_hash_entry *h;
- if (! XCOFF_XVECP (output_bfd->xvec))
+ if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour)
return true;
h = ((struct xcoff_link_hash_entry *)
{
struct xcoff_link_hash_entry *h;
- if (! XCOFF_XVECP (output_bfd->xvec))
+ if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour)
return true;
h = xcoff_link_hash_lookup (xcoff_hash_table (info), name, true, true,
struct bfd_strtab_hash *debug_strtab;
bfd_byte *debug_contents = NULL;
- if (! XCOFF_XVECP (output_bfd->xvec))
+ if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour)
{
for (i = 0; i < 6; i++)
special_sections[i] = NULL;