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

* elf32-fr30.c: Fix formatting.
	* elf32-hppa.c: Likewise.
	* elf32-i370.c: Likewise.
	* elf32-i386.c: Likewise.
	* elf32-i860.c: Likewise.
	* elf32-i960.c: Likewise.
This commit is contained in:
Kazu Hirata 2000-12-05 13:20:10 +00:00
parent 62fd9fad96
commit 6609fa7475
7 changed files with 86 additions and 141 deletions

View file

@ -1,3 +1,12 @@
2000-12-05 Kazu Hirata <kazu@hxi.com>
* elf32-fr30.c: Fix formatting.
* elf32-hppa.c: Likewise.
* elf32-i370.c: Likewise.
* elf32-i386.c: Likewise.
* elf32-i860.c: Likewise.
* elf32-i960.c: Likewise.
2000-12-03 Kazu Hirata <kazu@hxi.com>
* elf32-arm.h: Fix formatting.

View file

@ -422,7 +422,7 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca
srel = (bfd_signed_vma) relocation;
srel += rel->r_addend;
srel -= rel->r_offset;
srel -= 2; /* Branch instructions add 2 to the PC... */
srel -= 2; /* Branch instructions add 2 to the PC... */
srel -= (input_section->output_section->vma +
input_section->output_offset);
@ -439,7 +439,7 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca
srel = (bfd_signed_vma) relocation;
srel += rel->r_addend;
srel -= rel->r_offset;
srel -= 2; /* Branch instructions add 2 to the PC... */
srel -= 2; /* Branch instructions add 2 to the PC... */
srel -= (input_section->output_section->vma +
input_section->output_offset);
@ -757,7 +757,7 @@ fr30_elf_check_relocs (abfd, info, sec, relocs)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym);
sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym);
if (!elf_bad_symtab (abfd))
sym_hashes_end -= symtab_hdr->sh_info;

View file

@ -35,7 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "elf-hppa.h"
#include "elf32-hppa.h"
/* In order to gain some understanding of code in this file without
knowing all the intricate details of the linker, note the
following:
@ -47,7 +46,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
early in the link process, elf32_hppa_finish_dynamic_sections is
one of the last functions. */
/* We use two hash tables to hold information for linking PA ELF objects.
The first is the elf32_hppa_link_hash_table which is derived
@ -156,7 +154,6 @@ static const bfd_byte plt_stub[] =
#define RELATIVE_DYNAMIC_RELOCS 0
#endif
enum elf32_hppa_stub_type {
hppa_stub_long_branch,
hppa_stub_long_branch_shared,
@ -166,7 +163,6 @@ enum elf32_hppa_stub_type {
hppa_stub_none
};
struct elf32_hppa_stub_hash_entry {
/* Base hash table entry structure. */
@ -198,7 +194,6 @@ struct elf32_hppa_stub_hash_entry {
asection *id_sec;
};
struct elf32_hppa_link_hash_entry {
struct elf_link_hash_entry elf;
@ -240,7 +235,6 @@ struct elf32_hppa_link_hash_entry {
unsigned int plt_abs:1;
};
struct elf32_hppa_link_hash_table {
/* The main hash table. */
@ -290,7 +284,6 @@ struct elf32_hppa_link_hash_table {
unsigned int need_plt_stub:1;
};
/* Various hash macros and functions. */
#define hppa_link_hash_table(p) \
((struct elf32_hppa_link_hash_table *) ((p)->hash))
@ -308,7 +301,6 @@ static struct bfd_hash_entry *hppa_link_hash_newfunc
static struct bfd_link_hash_table *elf32_hppa_link_hash_table_create
PARAMS ((bfd *));
/* Stub handling functions. */
static char *hppa_stub_name
PARAMS ((const asection *, const asection *,
@ -334,7 +326,6 @@ static boolean hppa_build_one_stub
static boolean hppa_size_one_stub
PARAMS ((struct bfd_hash_entry *, PTR));
/* BFD and elf backend functions. */
static boolean elf32_hppa_object_p PARAMS ((bfd *));
@ -397,7 +388,6 @@ static boolean elf32_hppa_finish_dynamic_sections
static int elf32_hppa_elf_get_symbol_type
PARAMS ((Elf_Internal_Sym *, int));
/* Assorted hash table functions. */
/* Initialize an entry in the stub hash table. */
@ -445,7 +435,6 @@ stub_hash_newfunc (entry, table, string)
return (struct bfd_hash_entry *) ret;
}
/* Initialize an entry in the link hash table. */
static struct bfd_hash_entry *
@ -492,7 +481,6 @@ hppa_link_hash_newfunc (entry, table, string)
return (struct bfd_hash_entry *) ret;
}
/* Create the derived linker hash table. The PA ELF port uses the derived
hash table to keep information specific to the PA ELF linker (without
using static variables). */
@ -535,7 +523,6 @@ elf32_hppa_link_hash_table_create (abfd)
return &ret->root.root;
}
/* Build a name for an entry in the stub hash table. */
static char *
@ -576,7 +563,6 @@ hppa_stub_name (input_section, sym_sec, hash, rel)
return stub_name;
}
/* Look up an entry in the stub hash. Stub entries are cached because
creating the stub name takes a bit of time. */
@ -635,7 +621,6 @@ hppa_get_stub_entry (input_section, sym_sec, hash, rel, hplink)
return stub_entry;
}
/* Add a new stub entry to the stub hash. Not all fields of the new
stub entry are initialised. */
@ -694,7 +679,6 @@ hppa_add_stub (stub_name, section, hplink)
return stub_entry;
}
/* Determine the type of stub needed, if any, for a call. */
static enum elf32_hppa_stub_type
@ -771,7 +755,6 @@ hppa_type_of_stub (input_sec, rel, hash, destination)
return hppa_stub_none;
}
/* Build one linker stub as defined by the stub hash table entry GEN_ENTRY.
IN_ARG contains the link info pointer. */
@ -1082,7 +1065,6 @@ hppa_build_one_stub (gen_entry, in_arg)
#undef LDSID_RP_R1
#undef BE_SR0_RP
/* As above, but don't actually build the stub. Just bump offset so
we know stub section sizes. */
@ -1123,7 +1105,6 @@ hppa_size_one_stub (gen_entry, in_arg)
return true;
}
/* Return nonzero if ABFD represents an HPPA ELF32 file.
Additionally we set the default architecture and machine. */
@ -1147,7 +1128,6 @@ elf32_hppa_object_p (abfd)
return true;
}
/* Undo the generic ELF code's subtraction of section->vma from the
value of each external symbol. */
@ -1165,7 +1145,6 @@ elf32_hppa_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
return true;
}
/* Create the .plt and .got sections, and set up our hash table
short-cuts to various dynamic sections. */
@ -1207,7 +1186,6 @@ elf32_hppa_create_dynamic_sections (abfd, info)
return true;
}
/* Look through the relocs for a section during the first phase, and
allocate space in the global offset table or procedure linkage
table. At this point we haven't necessarily read all the input
@ -1696,7 +1674,6 @@ elf32_hppa_check_relocs (abfd, info, sec, relocs)
return true;
}
/* Return the section that should be marked against garbage collection
for a given relocation. */
@ -1745,7 +1722,6 @@ elf32_hppa_gc_mark_hook (abfd, info, rel, h, sym)
return NULL;
}
/* Update the got and plt entry reference counts for the section being
removed. */
@ -1855,7 +1831,6 @@ elf32_hppa_gc_sweep_hook (abfd, info, sec, relocs)
return true;
}
/* Our own version of hide_symbol, so that we can keep plt entries for
plabels. */
@ -1872,7 +1847,6 @@ elf32_hppa_hide_symbol (info, h)
}
}
/* Adjust a symbol defined by a dynamic object and referenced by a
regular object. The current definition is in some section of the
dynamic object, but we're not including those sections. We have to
@ -2041,7 +2015,6 @@ elf32_hppa_adjust_dynamic_symbol (info, h)
return true;
}
/* Called via elf_link_hash_traverse to create .plt entries for an
application that uses statically linked PIC functions. Similar to
the first part of elf32_hppa_adjust_dynamic_symbol. */
@ -2081,7 +2054,6 @@ hppa_handle_PIC_calls (h, inf)
return true;
}
#if ((! LONG_BRANCH_PIC_IN_SHLIB && LONG_BRANCH_VIA_PLT) \
|| RELATIVE_DYNAMIC_RELOCS)
/* This function is called via elf_link_hash_traverse to discard space
@ -2132,7 +2104,6 @@ hppa_discard_copies (h, inf)
}
#endif
/* This function is called via elf_link_hash_traverse to force
millicode symbols local so they do not end up as globals in the
dynamic symbol table. We ought to be able to do this in
@ -2152,7 +2123,6 @@ clobber_millicode_symbols (h, info)
return true;
}
/* Set the sizes of the dynamic sections. */
static boolean
@ -2437,7 +2407,6 @@ elf32_hppa_size_dynamic_sections (output_bfd, info)
return true;
}
/* External entry points for sizing and building linker stubs. */
/* Determine and set the size of the stub section for a final link.
@ -3068,7 +3037,6 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size,
return ret;
}
/* For a final link, this function is called after we have sized the
stubs to provide a value for __gp. */
@ -3138,7 +3106,6 @@ elf32_hppa_set_gp (abfd, info)
return true;
}
/* Build all the stubs associated with the current output file. The
stubs are kept in a hash table attached to the main linker hash
table. We also set up the .plt entries for statically linked PIC
@ -3177,7 +3144,6 @@ elf32_hppa_build_stubs (info)
return true;
}
/* Perform a relocation as part of a final link. */
static bfd_reloc_status_type
@ -3430,7 +3396,6 @@ final_link_relocate (input_section, contents, rel, value, hplink, sym_sec, h)
return bfd_reloc_ok;
}
/* Relocate an HPPA ELF section. */
static boolean
@ -3907,7 +3872,6 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
return true;
}
/* Finish up dynamic symbol handling. We set the contents of various
dynamic sections here. */
@ -4083,7 +4047,6 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
return true;
}
/* Finish up the dynamic sections. */
static boolean
@ -4216,7 +4179,6 @@ elf32_hppa_finish_dynamic_sections (output_bfd, info)
return true;
}
/* Called when writing out an object file to decide the type of a
symbol. */
static int
@ -4230,7 +4192,6 @@ elf32_hppa_elf_get_symbol_type (elf_sym, type)
return type;
}
/* Misc BFD support code. */
#define bfd_elf32_bfd_is_local_label_name elf_hppa_is_local_label_name
#define bfd_elf32_bfd_reloc_type_lookup elf_hppa_reloc_type_lookup

View file

@ -19,8 +19,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. */
/* This file is based on a preliminary PowerPC ELF ABI.
But its been hacked on for the IBM 360/370 architectures.
Basically, the 31bit relocation works, and just about everything
@ -28,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
dynamic loading to work ... its never been tested ...
*/
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
@ -272,7 +269,7 @@ i370_elf_howto_init ()
for (i = 0; i < sizeof (i370_elf_howto_raw) / sizeof (i370_elf_howto_raw[0]); i++)
{
type = i370_elf_howto_raw[i].type;
BFD_ASSERT (type < sizeof(i370_elf_howto_table) / sizeof(i370_elf_howto_table[0]));
BFD_ASSERT (type < sizeof (i370_elf_howto_table) / sizeof (i370_elf_howto_table[0]));
i370_elf_howto_table[type] = &i370_elf_howto_raw[i];
}
}
@ -350,7 +347,6 @@ static boolean i370_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_
#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so"
/* Set the howto pointer for an i370 ELF reloc. */
static void
@ -369,7 +365,7 @@ i370_elf_info_to_howto (abfd, cache_ptr, dst)
/* hack alert -- the following several routines look generic to me ...
* why are we bothering with them ???
*/
/* Function to set whether a module needs the -mrelocatable bit set. */
/* Function to set whether a module needs the -mrelocatable bit set. */
static boolean
i370_elf_set_private_flags (abfd, flags)
bfd *abfd;
@ -471,7 +467,6 @@ i370_elf_section_from_shdr (abfd, hdr, name)
return true;
}
/* Set up any other section flags and such that may be necessary. */
/* XXX hack alert bogus This routine is mostly all junk and almost
@ -479,7 +474,6 @@ i370_elf_section_from_shdr (abfd, hdr, name)
* just enough to allow glibc-2.1 ld.so to compile & link.
*/
static boolean
i370_elf_fake_sections (abfd, shdr, asect)
bfd *abfd ATTRIBUTE_UNUSED;
@ -610,7 +604,7 @@ i370_elf_create_dynamic_sections (abfd, info)
return false;
}
/* xxx beats me, seem to need a rela.text ... */
/* xxx beats me, seem to need a rela.text ... */
s = bfd_make_section (abfd, ".rela.text");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
@ -654,7 +648,6 @@ i370_elf_adjust_dynamic_symbol (info, h)
&& (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
s = bfd_get_section_by_name (dynobj, ".rela.text");
BFD_ASSERT (s != NULL);
s->_raw_size += sizeof (Elf32_External_Rela);
@ -879,7 +872,7 @@ i370_elf_size_dynamic_sections (output_bfd, info)
asection *target;
const char *outname;
/* Remember whether there are any relocation sections. */
/* Remember whether there are any relocation sections. */
relocs = true;
/* If this relocation section applies to a read only
@ -1419,12 +1412,12 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
relocation = 0;
else
{
(*info->callbacks->undefined_symbol)(info,
h->root.root.string,
input_bfd,
input_section,
rel->r_offset,
true);
(*info->callbacks->undefined_symbol) (info,
h->root.root.string,
input_bfd,
input_section,
rel->r_offset,
true);
ret = false;
continue;
}
@ -1562,9 +1555,9 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
#ifdef DEBUG
if (indx <= 0)
{
printf("indx=%d section=%s flags=%08x name=%s\n",
indx, osec->name, osec->flags,
h->root.root.string);
printf ("indx=%d section=%s flags=%08x name=%s\n",
indx, osec->name, osec->flags,
h->root.root.string);
}
#endif
}
@ -1602,7 +1595,6 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
continue;
}
#ifdef DEBUG
fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, offset = %ld, addend = %ld\n",
howto->name,
@ -1647,13 +1639,13 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
name = bfd_section_name (input_bfd, sec);
}
(*info->callbacks->reloc_overflow)(info,
name,
howto->name,
(bfd_vma) 0,
input_bfd,
input_section,
offset);
(*info->callbacks->reloc_overflow) (info,
name,
howto->name,
(bfd_vma) 0,
input_bfd,
input_section,
offset);
}
break;
@ -1661,7 +1653,6 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
}
#ifdef DEBUG
fprintf (stderr, "\n");
#endif
@ -1690,8 +1681,6 @@ i370_elf_post_process_headers (abfd, link_info)
#define ELF_MAXPAGESIZE 0x1000
#define elf_info_to_howto i370_elf_info_to_howto
#define elf_backend_plt_not_loaded 1
#define elf_backend_got_symbol_offset 4

View file

@ -150,7 +150,6 @@ static reloc_howto_type elf_howto_table[]=
};
#ifdef DEBUG_GEN_RELOC
#define TRACE(str) fprintf (stderr, "i386 bfd reloc lookup %d (%s)\n", code, str)
#else

View file

@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "elf-bfd.h"
#include "elf/i860.h"
/* Prototypes. */
static reloc_howto_type *lookup_howto
PARAMS ((unsigned int));
@ -59,8 +58,6 @@ static bfd_reloc_status_type i860_final_link_relocate
static boolean elf32_i860_is_local_label_name
PARAMS ((bfd *, const char *));
/* This howto table is preliminary. */
static reloc_howto_type elf32_i860_howto_table [] =
{
@ -573,7 +570,6 @@ lookup_howto (rtype)
return elf32_i860_howto_table + i;
}
/* Given a BFD reloc, return the matching HOWTO structure. */
static reloc_howto_type *
elf32_i860_reloc_type_lookup (abfd, code)
@ -693,7 +689,6 @@ elf32_i860_reloc_type_lookup (abfd, code)
return lookup_howto (rtype);
}
/* Given a ELF reloc, return the matching HOWTO structure. */
static void
elf32_i860_info_to_howto_rela (abfd, bfd_reloc, elf_reloc)
@ -704,7 +699,6 @@ elf32_i860_info_to_howto_rela (abfd, bfd_reloc, elf_reloc)
bfd_reloc->howto = lookup_howto (ELF32_R_TYPE (elf_reloc->r_info));
}
/* Specialized relocation handler for R_860_SPLITn. These relocations
involves a 16-bit field that is split into two contiguous parts. */
@ -731,7 +725,6 @@ elf32_i860_relocate_splitn (input_bfd, rello, contents, value)
return bfd_reloc_ok;
}
/* Specialized relocation handler for R_860_PC16. This relocation
involves a 16-bit, PC-relative field that is split into two contiguous
parts. */
@ -765,7 +758,6 @@ elf32_i860_relocate_pc16 (input_bfd, input_section, rello, contents, value)
}
/* Specialized relocation handler for R_860_PC26. This relocation
involves a 26-bit, PC-relative field which must be adjusted by 4. */
static bfd_reloc_status_type
@ -798,7 +790,6 @@ elf32_i860_relocate_pc26 (input_bfd, input_section, rello, contents, value)
}
/* Specialized relocation handler for R_860_HIGHADJ. */
static bfd_reloc_status_type
elf32_i860_relocate_highadj (input_bfd, rel, contents, value)
@ -821,7 +812,6 @@ elf32_i860_relocate_highadj (input_bfd, rel, contents, value)
return bfd_reloc_ok;
}
/* Perform a single relocation. By default we use the standard BFD
routines. However, we handle some specially. */
static bfd_reloc_status_type
@ -838,7 +828,6 @@ i860_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca
rel->r_addend);
}
/* Relocate an i860 ELF section.
This is boiler-plate code copied from fr30.
@ -1087,7 +1076,6 @@ elf32_i860_relocate_section (output_bfd, info, input_bfd, input_section,
return true;
}
/* Return whether a symbol name implies a local label. SVR4/860 compilers
generate labels of the form ".ep.function_name" to denote the end of a
function prolog. These should be local.
@ -1104,7 +1092,6 @@ elf32_i860_is_local_label_name (abfd, name)
return _bfd_elf_is_local_label_name (abfd, name);
}
#define TARGET_BIG_SYM bfd_elf32_i860_vec
#define TARGET_BIG_NAME "elf32-i860"

View file

@ -129,7 +129,7 @@ elf32_i960_relocate (abfd,
{
reloc_entry->addend -= symbol->value;
}
/* This is more dubious. */
/* This is more dubious. */
else if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) != 0)
{