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.
This commit is contained in:
parent
73bc900df9
commit
c4dfa77f43
8 changed files with 74 additions and 83 deletions
|
@ -1,3 +1,13 @@
|
|||
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
|
||||
|
|
|
@ -77,7 +77,7 @@ aout_adobe_swap_exec_header_out (abfd, execp, raw_bytes)
|
|||
{
|
||||
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);
|
||||
|
@ -88,7 +88,6 @@ aout_adobe_swap_exec_header_out (abfd, execp, raw_bytes)
|
|||
PUT_WORD (abfd, execp->a_drsize, bytes->e_drsize);
|
||||
}
|
||||
|
||||
|
||||
static const bfd_target *
|
||||
aout_adobe_object_p (abfd)
|
||||
bfd *abfd;
|
||||
|
@ -127,7 +126,6 @@ aout_adobe_object_p (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. */
|
||||
|
||||
|
@ -186,7 +184,7 @@ aout_adobe_callback (abfd)
|
|||
}
|
||||
|
||||
/* 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);
|
||||
|
@ -234,8 +232,8 @@ 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;
|
||||
|
@ -261,14 +259,13 @@ aout_adobe_mkobject (abfd)
|
|||
|
||||
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;
|
||||
|
@ -279,7 +276,7 @@ aout_adobe_write_object_contents (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;
|
||||
|
@ -457,9 +454,6 @@ aout_adobe_sizeof_headers (ignore_abfd, ignore)
|
|||
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
|
||||
|
|
|
@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License
|
|||
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 : \
|
||||
|
@ -159,7 +158,7 @@ MY(put_reloc)(abfd, r_extern, r_index, value, howto, reloc)
|
|||
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;
|
||||
|
||||
|
@ -206,7 +205,7 @@ MY(relocatable_reloc)(howto, abfd, reloc, amount, r_addr)
|
|||
& (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
|
||||
|
@ -397,7 +396,6 @@ MY_swap_std_reloc_out (abfd, g, natptr)
|
|||
r_pcrel = 1;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/* For a standard reloc, the addend is in the object file. */
|
||||
r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma;
|
||||
|
|
|
@ -47,7 +47,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
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
|
||||
|
@ -116,7 +116,6 @@ static boolean MY(set_sizes) PARAMS ((bfd *));
|
|||
#include "aout32.c"
|
||||
#include "aout-target.h"
|
||||
|
||||
|
||||
/* We need our own version to set header flags. */
|
||||
|
||||
static boolean
|
||||
|
@ -144,7 +143,6 @@ MY(write_object_contents) (abfd)
|
|||
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). */
|
||||
|
@ -221,7 +219,6 @@ MY(swap_ext_reloc_out) (abfd, g, natptr)
|
|||
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
|
||||
|
@ -275,7 +272,6 @@ MY(swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
|
|||
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. */
|
||||
|
|
|
@ -146,7 +146,6 @@ reloc_howto_type MY(howto_table)[] =
|
|||
"PCREL_32", true, 0xffffffff,0xffffffff, false),
|
||||
};
|
||||
|
||||
|
||||
#define CTOR_TABLE_RELOC_HOWTO(BFD) (MY(howto_table) + 14)
|
||||
|
||||
#define RELOC_STD_BITS_NS32K_TYPE_BIG 0x06
|
||||
|
@ -259,7 +258,6 @@ MY(bfd_reloc_type_lookup)(abfd,code)
|
|||
#undef ENTRY
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
MY_swap_std_reloc_in (abfd, bytes, cache_ptr, symbols, symcount)
|
||||
bfd *abfd;
|
||||
|
|
|
@ -61,7 +61,7 @@ MY(callback) (abfd)
|
|||
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;
|
||||
|
@ -178,7 +178,7 @@ MY(object_p) (abfd)
|
|||
* 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)
|
||||
|
@ -197,7 +197,6 @@ MY(object_p) (abfd)
|
|||
#define MY_object_p MY(object_p)
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef MY_mkobject
|
||||
|
||||
static boolean MY(mkobject) PARAMS ((bfd *));
|
||||
|
@ -230,7 +229,6 @@ MY(mkobject) (abfd)
|
|||
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;
|
||||
|
@ -530,7 +528,6 @@ MY_bfd_final_link (abfd, info)
|
|||
#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
|
||||
|
|
|
@ -128,7 +128,7 @@ static CONST struct aout_backend_data tic30_aout_backend_data =
|
|||
/* 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),
|
||||
|
@ -210,7 +210,7 @@ tic30_aout_reloc_howto (abfd, relocs, r_index, r_extern, r_pcrel)
|
|||
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)
|
||||
|
@ -224,11 +224,11 @@ tic30_aout_fix_16 (abfd, reloc_entry, symbol, data, input_section, output_bfd, e
|
|||
{
|
||||
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);
|
||||
|
@ -236,7 +236,7 @@ tic30_aout_fix_16 (abfd, reloc_entry, symbol, data, input_section, output_bfd, e
|
|||
}
|
||||
|
||||
/* 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,
|
||||
|
@ -251,11 +251,11 @@ 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);
|
||||
|
@ -267,7 +267,7 @@ tic30_aout_fix_32 (abfd, reloc_entry, symbol, data, input_section,
|
|||
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,
|
||||
|
@ -285,7 +285,7 @@ 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
|
||||
|
@ -295,7 +295,7 @@ tic30_aout_fix_pcrel_16 (abfd, reloc_entry, symbol, data, input_section,
|
|||
}
|
||||
|
||||
/* 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))
|
||||
|
@ -563,7 +563,7 @@ tic30_aout_object_p (abfd)
|
|||
* 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)
|
||||
|
@ -586,7 +586,6 @@ tic30_aout_object_p (abfd)
|
|||
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;
|
||||
|
@ -720,7 +719,7 @@ MY_bfd_final_link (abfd, info)
|
|||
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. */
|
||||
|
@ -765,7 +764,7 @@ MY_bfd_final_link (abfd, info)
|
|||
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);
|
||||
|
@ -961,7 +960,6 @@ tic30_aout_set_arch_mach (abfd, arch, machine)
|
|||
#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
|
||||
|
|
Loading…
Reference in a new issue