* aout-adobe.c: Fix formatting.
* aout-arm.c: Likewise.
* aout-cris.c: Likewise.
* aout-encap.c: Likewise.
* aout-ns32k.c: Likewise.
* aout-target.h: Likewise.
* aout-tic30.c: Likewise.
+2000-11-06 Kazu Hirata <kazu@hxi.com>
+
+ * aout-adobe.c: Fix formatting.
+ * aout-arm.c: Likewise.
+ * aout-cris.c: Likewise.
+ * aout-encap.c: Likewise.
+ * aout-ns32k.c: Likewise.
+ * aout-target.h: Likewise.
+ * aout-tic30.c: Likewise.
+
2000-11-05 Philip Blundell <philb@gnu.org>
* elf32-arm.h (elf32_arm_merge_private_bfd_data): Always permit
void aout_adobe_swap_exec_header_in
PARAMS ((bfd *abfd, struct external_exec *raw_bytes,
struct internal_exec *execp));
-
+
void
aout_adobe_swap_exec_header_in (abfd, raw_bytes, execp)
bfd *abfd;
{
struct external_exec *bytes = (struct external_exec *)raw_bytes;
- /* Now fill in fields in the raw data, from the fields in the exec struct. */
+ /* Now fill in fields in the raw data, from the fields in the exec struct. */
bfd_h_put_32 (abfd, execp->a_info , bytes->e_info);
PUT_WORD (abfd, execp->a_text , bytes->e_text);
PUT_WORD (abfd, execp->a_data , bytes->e_data);
PUT_WORD (abfd, execp->a_drsize, bytes->e_drsize);
}
-
static const bfd_target *
aout_adobe_object_p (abfd)
bfd *abfd;
return aout_32_some_aout_object_p (abfd, &anexec, aout_adobe_callback);
}
-
/* Finish up the opening of a b.out file for reading. Fill in all the
fields that are not handled by common code. */
default:
(*_bfd_error_handler)
- (_("%s: Unknown section type in a.out.adobe file: %x\n"),
+ (_("%s: Unknown section type in a.out.adobe file: %x\n"),
bfd_get_filename (abfd), ext->e_type[0]);
goto no_more_sections;
}
/* First one is called ".text" or whatever; subsequent ones are
- ".text1", ".text2", ... */
+ ".text1", ".text2", ... */
bfd_set_error (bfd_error_no_error);
sect = bfd_make_section (abfd, section_name);
break;
}
}
-no_more_sections:
+no_more_sections:
adata(abfd).reloc_entry_size = sizeof (struct reloc_std_external);
adata(abfd).symbol_entry_size = sizeof (struct external_nlist);
- adata(abfd).page_size = 1; /* Not applicable. */
- adata(abfd).segment_size = 1; /* Not applicable. */
+ adata(abfd).page_size = 1; /* Not applicable. */
+ adata(abfd).segment_size = 1; /* Not applicable. */
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return abfd->xvec;
adata(abfd).reloc_entry_size = sizeof (struct reloc_std_external);
adata(abfd).symbol_entry_size = sizeof (struct external_nlist);
- adata(abfd).page_size = 1; /* Not applicable. */
- adata(abfd).segment_size = 1; /* Not applicable. */
+ adata(abfd).page_size = 1; /* Not applicable. */
+ adata(abfd).segment_size = 1; /* Not applicable. */
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return true;
}
-
static boolean
aout_adobe_write_object_contents (abfd)
bfd *abfd;
exec_hdr (abfd)->a_info = ZMAGIC;
- /* Calculate text size as total of text sections, etc. */
+ /* Calculate text size as total of text sections, etc. */
exec_hdr (abfd)->a_text = 0;
exec_hdr (abfd)->a_data = 0;
return false;
/* Now write out reloc info, followed by syms and strings */
- if (bfd_get_symcount (abfd) != 0)
+ if (bfd_get_symcount (abfd) != 0)
{
if (bfd_seek (abfd, (file_ptr)(N_SYMOFF(*exec_hdr(abfd))), SEEK_SET)
!= 0)
return false;
}
-static int
+static int
aout_adobe_sizeof_headers (ignore_abfd, ignore)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
boolean ignore ATTRIBUTE_UNUSED;
return sizeof(struct internal_exec);
}
-
-
-
/* Build the transfer vector for Adobe A.Out files. */
#define aout_32_close_and_cleanup aout_32_bfd_free_cached_info
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
NULL,
-
+
(PTR) 0
};
/* BFD back-end for raw ARM a.out binaries.
Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
-
+
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
#define N_TXTADDR(x) \
((N_MAGIC(x) == NMAGIC) ? 0x8000 : \
(N_MAGIC(x) != ZMAGIC) ? 0 : \
PARAMS((bfd *, bfd_reloc_code_real_type));
static boolean MYARM(write_object_contents) PARAMS((bfd *));
-/* Avoid multiple defininitions from aoutx if supporting standarad a.out
+/* Avoid multiple defininitions from aoutx if supporting standarad a.out
as well as our own. */
#define NAME(x,y) CAT3(aoutarm,_32_,y)
static void MY(swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *,
arelent *, asymbol **,
bfd_size_type));
-void MY(swap_std_reloc_out) PARAMS ((bfd *, arelent *,
+void MY(swap_std_reloc_out) PARAMS ((bfd *, arelent *,
struct reloc_std_external *));
reloc_howto_type MY(howto_table)[] =
return MY(howto_table) + index;
}
-
+
#define MY_reloc_howto(BFD, REL, IN, EX, PC) \
MY(reloc_howto) (BFD, REL, &IN, &EX, &PC)
PUT_WORD (abfd, value, reloc->r_address);
r_length = howto->size ; /* Size as a power of two */
- /* Special case for branch relocations. */
+ /* Special case for branch relocations. */
if (howto->type == 3 || howto->type == 7)
r_length = 3;
| (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE));
}
}
-
+
#define MY_put_reloc(BFD, EXT, IDX, VAL, HOWTO, RELOC) \
MY(put_reloc)(BFD, EXT, IDX, VAL, HOWTO, RELOC)
{
if (howto->type == 3)
{
- if (reloc->r_type[0]
+ if (reloc->r_type[0]
& (bfd_header_big_endian (abfd)
? RELOC_STD_BITS_EXTERN_BIG : RELOC_STD_BITS_EXTERN_LITTLE))
{
- /* The reloc is still external, so don't modify anything. */
+ /* The reloc is still external, so don't modify anything. */
*amount = 0;
}
else
bfd_size_type addr = reloc_entry->address;
long target = bfd_get_32 (abfd, (bfd_byte *) data + addr);
bfd_reloc_status_type flag = bfd_reloc_ok;
-
+
/* If this is an undefined symbol, return error */
if (symbol->section == &bfd_und_section
&& (symbol->flags & BSF_WEAK) == 0)
/* Now the ARM magic... Change the reloc type so that it is marked as done.
Strictly this is only necessary if we are doing a partial relocation. */
reloc_entry->howto = &MY(howto_table)[7];
-
+
return flag;
}
r_pcrel = 0;
}
else if (g->howto->type == 7)
- {
+ {
r_length = 3;
r_pcrel = 1;
}
-
#if 0
/* For a standard reloc, the addend is in the object file. */
BFD_JUMP_TABLE_DYNAMIC (MY),
& aout_arm_big_vec,
-
+
(PTR) MY_backend_data,
};
BFD_JUMP_TABLE_DYNAMIC (MY),
& aout_arm_little_vec,
-
+
(PTR) MY_backend_data,
};
adata(abfd).zmagic_disk_block_size, even though the exec_header is
*not* included in the text segment. A simple workaround is to
#define ZMAGIC_DISK_BLOCK_SIZE, which is used if defined; otherwise
- TARGET_PAGE_SIZE is used. */
+ TARGET_PAGE_SIZE is used. */
#define ZMAGIC_DISK_BLOCK_SIZE N_TXTOFF (0)
/* It seems odd at first to set a page-size this low, but gives greater
#include "aout32.c"
#include "aout-target.h"
-
/* We need our own version to set header flags. */
static boolean
return true;
}
-
/* We need our own for these reasons:
- - Assert that a normal 8, 16 or 32 reloc is output.
- - Fix what seems to be a weak-bug (perhaps there for valid reasons). */
+ - Assert that a normal 8, 16 or 32 reloc is output.
+ - Fix what seems to be a weak-bug (perhaps there for valid reasons). */
static void
MY(swap_ext_reloc_out) (abfd, g, natptr)
{
(*_bfd_error_handler) (_("%s: Invalid relocation type exported: %d"),
bfd_get_filename (abfd), r_type);
-
+
bfd_set_error (bfd_error_wrong_format);
}
PUT_WORD (abfd, r_addend, natptr->r_addend);
}
-
/* We need our own to assert that a normal 8, 16 or 32 reloc is input. */
static void
{
(*_bfd_error_handler) (_("%s: Invalid relocation type imported: %d"),
bfd_get_filename (abfd), r_type);
-
+
bfd_set_error(bfd_error_wrong_format);
}
-
+
cache_ptr->howto = howto_table_ext + r_type;
if (r_extern && r_index > symcount)
(*_bfd_error_handler)
(_("%s: Bad relocation record imported: %d"),
bfd_get_filename (abfd), r_index);
-
+
bfd_set_error (bfd_error_wrong_format);
/* We continue, so we can catch further errors. */
MOVE_ADDRESS (GET_SWORD (abfd, bytes->r_addend));
}
-
/* We use the same as the default, except that we also set
"obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;", to avoid changing
NAME (aout, set_arch_mach) in aoutx. */
target-specific things should not be added there. */
obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
-
+
return true;
}
bfd_set_error (bfd_error_wrong_format);
return 0;
}
-
+
coff_magic = bfd_h_get_16 (abfd, magicbuf);
if (coff_magic != COFF_MAGIC)
return 0; /* Not an encap coff file */
bfd *abfd;
{
struct internal_exec *execp = exec_hdr (abfd);
-
+
MY(callback)(abfd, execp);
-
+
/* If we have a coff header, it can give us better values for
text_start and exec_data_start. This is particularly useful
for remote debugging of embedded systems. */
*
*/
-reloc_howto_type MY(howto_table)[] =
+reloc_howto_type MY(howto_table)[] =
{
/* ns32k immediate operands */
HOWTO (BFD_RELOC_NS32K_IMM_8, 0, 0, 8, false, 0, true,
"PCREL_32", true, 0xffffffff,0xffffffff, false),
};
-
#define CTOR_TABLE_RELOC_HOWTO(BFD) (MY(howto_table) + 14)
#define RELOC_STD_BITS_NS32K_TYPE_BIG 0x06
#undef ENTRY
}
-
static void
MY_swap_std_reloc_in (abfd, bytes, cache_ptr, symbols, symcount)
bfd *abfd;
asection *output_section = sym->section->output_section;
r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma;
-
+
/* name was clobbered by aout_write_syms to be symbol index */
- /* If this relocation is relative to a symbol then set the
+ /* If this relocation is relative to a symbol then set the
r_index to the symbols index, and the r_extern bit.
Absolute symbols can come in in two ways, either as an offset
if (bfd_is_com_section (output_section)
|| output_section == &bfd_abs_section
- || output_section == &bfd_und_section)
+ || output_section == &bfd_und_section)
{
if (bfd_abs_section.symbol == sym)
{
r_index = 0;
r_extern = 0;
}
- else
+ else
{
/* Fill in symbol */
r_extern = 1;
#undef KEEPIT
#define KEEPIT udata.i
r_index = (*(g->sym_ptr_ptr))->KEEPIT;
-#undef KEEPIT
+#undef KEEPIT
}
}
- else
+ else
{
/* Just an ordinary section */
r_extern = 0;
- r_index = output_section->target_index;
+ r_index = output_section->target_index;
}
MY_put_reloc (abfd, r_extern, r_index, g->address, g->howto, natptr);
bfd_vma adjust;
adjust = execp->a_entry - obj_textsec (abfd)->vma;
- /* Adjust only by whole pages. */
+ /* Adjust only by whole pages. */
adjust &= ~(TARGET_PAGE_SIZE - 1);
obj_textsec (abfd)->vma += adjust;
obj_datasec (abfd)->vma += adjust;
/* The file offsets of the string table and symbol table. */
obj_sym_filepos (abfd) = N_SYMOFF (*execp);
obj_str_filepos (abfd) = N_STROFF (*execp);
-
+
/* Determine the architecture and machine type of the object file. */
#ifdef SET_ARCH_MACH
SET_ARCH_MACH(abfd, *execp);
* means that it isn't obvious if EXEC_P should be set.
* All of the following must be true for an executable:
* There must be no relocations, the bfd can be neither an
- * archive nor an archive element, and the file must be executable. */
+ * archive nor an archive element, and the file must be executable. */
if (exec.a_trsize + exec.a_drsize == 0
&& bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
#define MY_object_p MY(object_p)
#endif
-
#ifndef MY_mkobject
static boolean MY(mkobject) PARAMS ((bfd *));
static boolean MY_bfd_copy_private_section_data
PARAMS ((bfd *, asection *, bfd *, asection *));
-/*ARGSUSED*/
static boolean
MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
bfd *ibfd;
#define MY_bfd_link_split_section _bfd_generic_link_split_section
#endif
-
#ifndef MY_bfd_copy_private_bfd_data
#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#endif
#endif
/* Aout symbols normally have leading underscores */
-#ifndef MY_symbol_leading_char
+#ifndef MY_symbol_leading_char
#define MY_symbol_leading_char '_'
#endif
/* Alternative_target */
NULL,
-
+
(PTR) MY_backend_data
};
#endif /* MY_BFD_TARGET */
/* This table lists the relocation types for the TMS320C30. There are
only a few relocations required, and all must be divided by 4 (>>
2) to get the 32-bit addresses in the format the TMS320C30 likes
- it. */
+ it. */
reloc_howto_type tic30_aout_howto_table[] =
{
EMPTY_HOWTO (-1),
requires that any relocations for the data section should point to
the end of the aligned text section, plus an offset. By default,
this does not happen, therefore this function takes care of
- that. */
+ that. */
static bfd_reloc_status_type
tic30_aout_fix_16 (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message)
{
bfd_vma relocation;
- /* Make sure that the symbol's section is defined. */
+ /* Make sure that the symbol's section is defined. */
if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0)
return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
/* Get the size of the input section and turn it into the TMS320C30
- 32-bit address format. */
+ 32-bit address format. */
relocation = (symbol->section->vma >> 2);
relocation += bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address);
bfd_put_16 (abfd, relocation, (bfd_byte *) data + reloc_entry->address);
}
/* This function does the same thing as tic30_aout_fix_16 except for 32
- bit relocations. */
+ bit relocations. */
static bfd_reloc_status_type
tic30_aout_fix_32 (abfd, reloc_entry, symbol, data, input_section,
{
bfd_vma relocation;
- /* Make sure that the symbol's section is defined. */
+ /* Make sure that the symbol's section is defined. */
if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0)
return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
/* Get the size of the input section and turn it into the TMS320C30
- 32-bit address format. */
+ 32-bit address format. */
relocation = (symbol->section->vma >> 2);
relocation += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address);
bfd_put_32 (abfd, relocation, (bfd_byte *) data + reloc_entry->address);
useless for a relocation, so we just get the offset value and place
a version of this within the object code.
tic30_aout_final_link_relocate will then calculate the required
- relocation to add on to the value in the object code. */
+ relocation to add on to the value in the object code. */
static bfd_reloc_status_type
tic30_aout_fix_pcrel_16 (abfd, reloc_entry, symbol, data, input_section,
/* The byte before the location of the fix contains bits 23-16 of
the pcrel instruction. Bit 21 is set for a delayed instruction
- which requires on offset of 3 instead of 1. */
+ which requires on offset of 3 instead of 1. */
if (offset_data & 0x20)
relocation -= 3;
else
}
/* These macros will get 24-bit values from the bfd definition.
- Big-endian only. */
+ Big-endian only. */
#define bfd_getb_24(BFD,ADDR) (bfd_get_8(BFD,ADDR) << 16) | \
(bfd_get_8(BFD,ADDR+1) << 8) | \
(bfd_get_8(BFD,ADDR+2))
* means that it isn't obvious if EXEC_P should be set.
* All of the following must be true for an executable:
* There must be no relocations, the bfd can be neither an
- * archive nor an archive element, and the file must be executable. */
+ * archive nor an archive element, and the file must be executable. */
if (exec.a_trsize + exec.a_drsize == 0
&& bfd_get_format (abfd) == bfd_object && abfd->my_archive == NULL)
section contents, and copy_private_bfd_data is not called until
after the section contents have been set. */
-/*ARGSUSED */
static boolean
MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
bfd *ibfd;
int pad;
/* Set the executable header size to 0, as we don't want one for an
- output. */
+ output. */
adata (abfd).exec_bytes_size = 0;
pos = adata (abfd).exec_bytes_size;
/* Text. */
obj_bsssec (abfd)->vma = vma;
obj_bsssec (abfd)->user_set_vma = 1;
- /* We are fully resized, so don't readjust in final_link. */
+ /* We are fully resized, so don't readjust in final_link. */
adata (abfd).magic = z_magic;
return NAME (aout, final_link) (abfd, info, MY_final_link_callback);
#define MY_bfd_link_split_section _bfd_generic_link_split_section
#endif
-
#ifndef MY_bfd_copy_private_bfd_data
#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#endif
BFD_JUMP_TABLE_DYNAMIC (MY),
NULL,
-
+
(PTR) MY_backend_data
};
#endif /* MY_BFD_TARGET */