2000-12-08 Kazu Hirata <kazu@hxi.com>

* elf64-alpha.c: Fix formatting.
	* elf64-hppa.c: Likewise.
	* elf64-mips.c: Likewise.
This commit is contained in:
Kazu Hirata
2000-12-09 01:54:51 +00:00
parent 40293bdaea
commit fe8bc63d5e
4 changed files with 73 additions and 78 deletions

@ -29,6 +29,7 @@
2000-12-08 Kazu Hirata <kazu@hxi.com> 2000-12-08 Kazu Hirata <kazu@hxi.com>
* coffgen.c: Fix formatting. * coffgen.c: Fix formatting.
* elf-m10300.c: Likewise.
* elf32-i386.c: Likewise. * elf32-i386.c: Likewise.
* elf32-i960.c: Likewise. * elf32-i960.c: Likewise.
* elf32-m68k.c: Likewise. * elf32-m68k.c: Likewise.
@ -37,8 +38,10 @@
* elf32-sh.c: Likewise. * elf32-sh.c: Likewise.
* elf32-sparc.c: Likewise. * elf32-sparc.c: Likewise.
* elf32-v850.c: Likewise. * elf32-v850.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-mips.c: Likewise.
* elf64-sparc.c: Likewise. * elf64-sparc.c: Likewise.
* elf-m10300.c: Likewise.
2000-12-07 Kazu Hirata <kazu@hxi.com> 2000-12-07 Kazu Hirata <kazu@hxi.com>

@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define NO_COFF_SYMBOLS #define NO_COFF_SYMBOLS
#define NO_COFF_LINENOS #define NO_COFF_LINENOS
/* Get the ECOFF swapping routines. Needed for the debug information. */ /* Get the ECOFF swapping routines. Needed for the debug information. */
#include "coff/internal.h" #include "coff/internal.h"
#include "coff/sym.h" #include "coff/sym.h"
#include "coff/symconst.h" #include "coff/symconst.h"
@ -762,7 +762,7 @@ static reloc_howto_type elf64_alpha_howto_table[] =
0, /* dst_mask */ 0, /* dst_mask */
false), /* pcrel_offset */ false), /* pcrel_offset */
/* Misc ELF relocations. */ /* Misc ELF relocations. */
/* A dynamic relocation to copy the target into our .dynbss section. */ /* A dynamic relocation to copy the target into our .dynbss section. */
/* Not generated, as all Alpha objects use PIC, so it is not needed. It /* Not generated, as all Alpha objects use PIC, so it is not needed. It
@ -979,7 +979,7 @@ static const struct elf_reloc_map elf64_alpha_reloc_map[] =
/* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to process /* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to process
the explicit !<reloc>!sequence relocations, and are mapped into the normal the explicit !<reloc>!sequence relocations, and are mapped into the normal
relocations at the end of processing. */ relocations at the end of processing. */
{BFD_RELOC_ALPHA_USER_LITERAL, R_ALPHA_LITERAL}, {BFD_RELOC_ALPHA_USER_LITERAL, R_ALPHA_LITERAL},
{BFD_RELOC_ALPHA_USER_LITUSE_BASE, R_ALPHA_LITUSE}, {BFD_RELOC_ALPHA_USER_LITUSE_BASE, R_ALPHA_LITUSE},
{BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF, R_ALPHA_LITUSE}, {BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF, R_ALPHA_LITUSE},
@ -1125,7 +1125,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend)
flags |= 1 << urel->r_addend; flags |= 1 << urel->r_addend;
} }
/* A little preparation for the loop... */ /* A little preparation for the loop... */
disp = symval - info->gp; disp = symval - info->gp;
for (urel = irel+1, i = 0; i < count; ++i, ++urel) for (urel = irel+1, i = 0; i < count; ++i, ++urel)
@ -1161,7 +1161,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend)
if (fits16) if (fits16)
{ {
/* Take the op code and dest from this insn, take the base /* Take the op code and dest from this insn, take the base
register from the literal insn. Leave the offset alone. */ register from the literal insn. Leave the offset alone. */
insn = (insn & 0xffe0ffff) | (lit_insn & 0x001f0000); insn = (insn & 0xffe0ffff) | (lit_insn & 0x001f0000);
urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
R_ALPHA_GPRELLOW); R_ALPHA_GPRELLOW);
@ -1224,7 +1224,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend)
{ {
Elf_Internal_Rela *xrel; Elf_Internal_Rela *xrel;
/* Preserve branch prediction call stack when possible. */ /* Preserve branch prediction call stack when possible. */
if ((insn & INSN_JSR_MASK) == INSN_JSR) if ((insn & INSN_JSR_MASK) == INSN_JSR)
insn = (OP_BSR << 26) | (insn & 0x03e00000); insn = (OP_BSR << 26) | (insn & 0x03e00000);
else else
@ -1319,7 +1319,7 @@ elf64_alpha_relax_opt_call (info, symval)
Elf_Internal_Rela *tsec_relocs, *tsec_relend, *tsec_free, *gpdisp; Elf_Internal_Rela *tsec_relocs, *tsec_relend, *tsec_free, *gpdisp;
bfd_vma ofs; bfd_vma ofs;
/* Load the relocations from the section that the target symbol is in. */ /* Load the relocations from the section that the target symbol is in. */
if (info->sec == info->tsec) if (info->sec == info->tsec)
{ {
tsec_relocs = info->relocs; tsec_relocs = info->relocs;
@ -1469,7 +1469,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again)
if (! link_info->keep_memory) if (! link_info->keep_memory)
free_relocs = internal_relocs; free_relocs = internal_relocs;
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof (info));
info.abfd = abfd; info.abfd = abfd;
info.sec = sec; info.sec = sec;
info.link_info = link_info; info.link_info = link_info;
@ -1553,7 +1553,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again)
else if (isym.st_shndx == SHN_COMMON) else if (isym.st_shndx == SHN_COMMON)
info.tsec = bfd_com_section_ptr; info.tsec = bfd_com_section_ptr;
else else
continue; /* who knows. */ continue; /* who knows. */
info.h = NULL; info.h = NULL;
info.other = isym.st_other; info.other = isym.st_other;
@ -1971,7 +1971,7 @@ elf64_alpha_read_ecoff_info (abfd, section, debug)
char *ext_hdr = NULL; char *ext_hdr = NULL;
swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
memset (debug, 0, sizeof(*debug)); memset (debug, 0, sizeof (*debug));
ext_hdr = (char *) bfd_malloc ((size_t) swap->external_hdr_size); ext_hdr = (char *) bfd_malloc ((size_t) swap->external_hdr_size);
if (ext_hdr == NULL && swap->external_hdr_size != 0) if (ext_hdr == NULL && swap->external_hdr_size != 0)
@ -2565,7 +2565,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
don't know whether we'll actually need a dynamic relocation don't know whether we'll actually need a dynamic relocation
entry for this reloc. So make a record of it. Once we entry for this reloc. So make a record of it. Once we
find out if this thing needs dynamic relocation we'll find out if this thing needs dynamic relocation we'll
expand the relocation sections by the appropriate amount. */ expand the relocation sections by the appropriate amount. */
struct alpha_elf_reloc_entry *rent; struct alpha_elf_reloc_entry *rent;
@ -3137,7 +3137,7 @@ elf64_alpha_calc_dynrel_sizes (h, info)
|| relent->rtype == R_ALPHA_REFQUAD) || relent->rtype == R_ALPHA_REFQUAD)
{ {
relent->srel->_raw_size += relent->srel->_raw_size +=
sizeof(Elf64_External_Rela) * relent->count; sizeof (Elf64_External_Rela) * relent->count;
} }
dynobj = elf_hash_table(info)->dynobj; dynobj = elf_hash_table(info)->dynobj;
@ -3212,7 +3212,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info)
i = alpha_elf_tdata(i)->got_link_next) i = alpha_elf_tdata(i)->got_link_next)
count += alpha_elf_tdata(i)->n_local_got_entries; count += alpha_elf_tdata(i)->n_local_got_entries;
srel->_raw_size += count * sizeof(Elf64_External_Rela); srel->_raw_size += count * sizeof (Elf64_External_Rela);
} }
} }
/* else we're not dynamic and by definition we don't need such things. */ /* else we're not dynamic and by definition we don't need such things. */
@ -3315,7 +3315,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info)
if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0) if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0)
|| ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0) || ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0)
|| ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT, || ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT,
sizeof(Elf64_External_Rela))) sizeof (Elf64_External_Rela)))
return false; return false;
if (reltext) if (reltext)
@ -3528,7 +3528,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
case R_ALPHA_OP_PSUB: case R_ALPHA_OP_PSUB:
case R_ALPHA_OP_PRSHIFT: case R_ALPHA_OP_PRSHIFT:
/* We hate these silly beasts. */ /* We hate these silly beasts. */
abort(); abort ();
case R_ALPHA_LITERAL: case R_ALPHA_LITERAL:
{ {
@ -3582,7 +3582,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
((Elf64_External_Rela *) ((Elf64_External_Rela *)
srelgot->contents) srelgot->contents)
+ srelgot->reloc_count++); + srelgot->reloc_count++);
BFD_ASSERT (sizeof(Elf64_External_Rela) BFD_ASSERT (sizeof (Elf64_External_Rela)
* srelgot->reloc_count * srelgot->reloc_count
<= srelgot->_cooked_size); <= srelgot->_cooked_size);
} }
@ -3687,7 +3687,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
((Elf64_External_Rela *) ((Elf64_External_Rela *)
srel->contents) srel->contents)
+ srel->reloc_count++); + srel->reloc_count++);
BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
<= srel->_cooked_size); <= srel->_cooked_size);
} }
goto default_reloc; goto default_reloc;
@ -3840,7 +3840,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
((Elf64_External_Rela *) ((Elf64_External_Rela *)
srel->contents) srel->contents)
+ srel->reloc_count++); + srel->reloc_count++);
BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
<= srel->_cooked_size); <= srel->_cooked_size);
} }
@ -3873,7 +3873,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_elf64_swap_reloca_out (output_bfd, &outrel, bfd_elf64_swap_reloca_out (output_bfd, &outrel,
((Elf64_External_Rela *)srel->contents ((Elf64_External_Rela *)srel->contents
+ srel->reloc_count++)); + srel->reloc_count++));
BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
<= srel->_cooked_size); <= srel->_cooked_size);
} }
} }
@ -4291,7 +4291,6 @@ elf64_alpha_final_link (abfd, info)
} }
#endif #endif
/* Build the external symbol information. */ /* Build the external symbol information. */
einfo.abfd = abfd; einfo.abfd = abfd;
einfo.info = info; einfo.info = info;
@ -4611,7 +4610,7 @@ elf64_alpha_final_link (abfd, info)
/* ECOFF swapping routines. These are used when dealing with the /* ECOFF swapping routines. These are used when dealing with the
.mdebug section, which is in the ECOFF debugging format. Copied .mdebug section, which is in the ECOFF debugging format. Copied
from elf32-mips.c. */ from elf32-mips.c. */
static const struct ecoff_debug_swap static const struct ecoff_debug_swap
elf64_alpha_ecoff_debug_swap = elf64_alpha_ecoff_debug_swap =
{ {

@ -169,19 +169,17 @@ static struct elf64_hppa_dyn_hash_entry *elf64_hppa_dyn_hash_lookup
boolean create, boolean copy)); boolean create, boolean copy));
static void elf64_hppa_dyn_hash_traverse static void elf64_hppa_dyn_hash_traverse
PARAMS ((struct elf64_hppa_dyn_hash_table *table, PARAMS ((struct elf64_hppa_dyn_hash_table *table,
boolean (*func)(struct elf64_hppa_dyn_hash_entry *, PTR), boolean (*func) (struct elf64_hppa_dyn_hash_entry *, PTR),
PTR info)); PTR info));
static const char *get_dyn_name static const char *get_dyn_name
PARAMS ((asection *, struct elf_link_hash_entry *, PARAMS ((asection *, struct elf_link_hash_entry *,
const Elf_Internal_Rela *, char **, size_t *)); const Elf_Internal_Rela *, char **, size_t *));
/* This must follow the definitions of the various derived linker /* This must follow the definitions of the various derived linker
hash tables and shared functions. */ hash tables and shared functions. */
#include "elf-hppa.h" #include "elf-hppa.h"
static boolean elf64_hppa_object_p static boolean elf64_hppa_object_p
PARAMS ((bfd *)); PARAMS ((bfd *));
@ -266,7 +264,7 @@ elf64_hppa_dyn_hash_table_init (ht, abfd, new)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
new_hash_entry_func new; new_hash_entry_func new;
{ {
memset (ht, 0, sizeof(*ht)); memset (ht, 0, sizeof (*ht));
return bfd_hash_table_init (&ht->root, new); return bfd_hash_table_init (&ht->root, new);
} }
@ -289,7 +287,7 @@ elf64_hppa_new_dyn_hash_entry (entry, table, string)
/* Initialize our local data. All zeros, and definitely easier /* Initialize our local data. All zeros, and definitely easier
than setting 8 bit fields. */ than setting 8 bit fields. */
memset (ret, 0, sizeof(*ret)); memset (ret, 0, sizeof (*ret));
/* Call the allocation method of the superclass. */ /* Call the allocation method of the superclass. */
ret = ((struct elf64_hppa_dyn_hash_entry *) ret = ((struct elf64_hppa_dyn_hash_entry *)
@ -394,7 +392,6 @@ elf64_hppa_section_from_shdr (abfd, hdr, name)
return true; return true;
} }
/* Construct a string for use in the elf64_hppa_dyn_hash_table. The /* Construct a string for use in the elf64_hppa_dyn_hash_table. The
name describes what was once potentially anonymous memory. We name describes what was once potentially anonymous memory. We
allocate memory as necessary, possibly reusing PBUF/PLEN. */ allocate memory as necessary, possibly reusing PBUF/PLEN. */
@ -2197,7 +2194,6 @@ elf64_hppa_finalize_dlt (dyn_h, data)
= _bfd_elf_link_lookup_local_dynindx (info, dyn_h->owner, = _bfd_elf_link_lookup_local_dynindx (info, dyn_h->owner,
dyn_h->sym_indx); dyn_h->sym_indx);
/* Create a dynamic relocation for this entry. Do include the output /* Create a dynamic relocation for this entry. Do include the output
offset of the DLT entry since we need an absolute address in the offset of the DLT entry since we need an absolute address in the
resulting object file. */ resulting object file. */
@ -2370,7 +2366,6 @@ elf64_hppa_finish_dynamic_sections (output_bfd, info)
elf64_hppa_finalize_dlt, elf64_hppa_finalize_dlt,
info); info);
sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
if (elf_hash_table (info)->dynamic_sections_created) if (elf_hash_table (info)->dynamic_sections_created)
@ -2453,7 +2448,6 @@ elf64_hppa_finish_dynamic_sections (output_bfd, info)
return true; return true;
} }
/* Return the number of additional phdrs we will need. /* Return the number of additional phdrs we will need.
The generic ELF code only creates PT_PHDRs for executables. The HP The generic ELF code only creates PT_PHDRs for executables. The HP
@ -2631,7 +2625,6 @@ const struct elf_size_info hppa64_elf_size_info =
#define elf_backend_link_output_symbol_hook \ #define elf_backend_link_output_symbol_hook \
elf64_hppa_link_output_symbol_hook elf64_hppa_link_output_symbol_hook
#define elf_backend_want_got_plt 0 #define elf_backend_want_got_plt 0
#define elf_backend_plt_readonly 0 #define elf_backend_plt_readonly 0
#define elf_backend_want_plt_sym 0 #define elf_backend_want_plt_sym 0