2001-02-01 Kazu Hirata <kazu@hxi.com>
* elf-m10300.c: Fix formatting.
This commit is contained in:
parent
0088edd2a0
commit
010ac81f2a
|
@ -1,3 +1,7 @@
|
|||
2001-02-01 Kazu Hirata <kazu@hxi.com>
|
||||
|
||||
* elf-m10300.c: Fix formatting.
|
||||
|
||||
2001-01-30 Alan Modra <alan@linuxcare.com.au>
|
||||
|
||||
* elf64-hppa.c (elf64_hppa_elf_get_symbol_type): New function.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* Matsushita 10300 specific support for 32-bit ELF
|
||||
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
|
@ -23,8 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
#include "elf-bfd.h"
|
||||
#include "elf/mn10300.h"
|
||||
|
||||
struct elf32_mn10300_link_hash_entry
|
||||
{
|
||||
struct elf32_mn10300_link_hash_entry {
|
||||
/* The basic elf link hash table entry. */
|
||||
struct elf_link_hash_entry root;
|
||||
|
||||
|
@ -62,8 +62,7 @@ struct elf32_mn10300_link_hash_entry
|
|||
/* We derive a hash table from the main elf linker hash table so
|
||||
we can store state variables and a secondary hash table without
|
||||
resorting to global variables. */
|
||||
struct elf32_mn10300_link_hash_table
|
||||
{
|
||||
struct elf32_mn10300_link_hash_table {
|
||||
/* The main hash table. */
|
||||
struct elf_link_hash_table root;
|
||||
|
||||
|
@ -119,8 +118,7 @@ static void compute_function_info
|
|||
does absolutely nothing. */
|
||||
#define USE_RELA
|
||||
|
||||
static reloc_howto_type elf_mn10300_howto_table[] =
|
||||
{
|
||||
static reloc_howto_type elf_mn10300_howto_table[] = {
|
||||
/* Dummy relocation. Does nothing. */
|
||||
HOWTO (R_MN10300_NONE,
|
||||
0,
|
||||
|
@ -264,17 +262,14 @@ static reloc_howto_type elf_mn10300_howto_table[] =
|
|||
0xffffff,
|
||||
0xffffff,
|
||||
false),
|
||||
|
||||
};
|
||||
|
||||
struct mn10300_reloc_map
|
||||
{
|
||||
struct mn10300_reloc_map {
|
||||
bfd_reloc_code_real_type bfd_reloc_val;
|
||||
unsigned char elf_reloc_val;
|
||||
};
|
||||
|
||||
static const struct mn10300_reloc_map mn10300_reloc_map[] =
|
||||
{
|
||||
static const struct mn10300_reloc_map mn10300_reloc_map[] = {
|
||||
{ BFD_RELOC_NONE, R_MN10300_NONE, },
|
||||
{ BFD_RELOC_32, R_MN10300_32, },
|
||||
{ BFD_RELOC_16, R_MN10300_16, },
|
||||
|
@ -459,7 +454,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
|
|||
case R_MN10300_24:
|
||||
value += addend;
|
||||
|
||||
if ((long)value > 0x7fffff || (long)value < -0x800000)
|
||||
if ((long) value > 0x7fffff || (long) value < -0x800000)
|
||||
return bfd_reloc_overflow;
|
||||
|
||||
bfd_put_8 (input_bfd, value & 0xff, hit_data);
|
||||
|
@ -470,7 +465,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
|
|||
case R_MN10300_16:
|
||||
value += addend;
|
||||
|
||||
if ((long)value > 0x7fff || (long)value < -0x8000)
|
||||
if ((long) value > 0x7fff || (long) value < -0x8000)
|
||||
return bfd_reloc_overflow;
|
||||
|
||||
bfd_put_16 (input_bfd, value, hit_data);
|
||||
|
@ -479,7 +474,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
|
|||
case R_MN10300_8:
|
||||
value += addend;
|
||||
|
||||
if ((long)value > 0x7f || (long)value < -0x80)
|
||||
if ((long) value > 0x7f || (long) value < -0x80)
|
||||
return bfd_reloc_overflow;
|
||||
|
||||
bfd_put_8 (input_bfd, value, hit_data);
|
||||
|
@ -491,7 +486,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
|
|||
value -= offset;
|
||||
value += addend;
|
||||
|
||||
if ((long)value > 0xff || (long)value < -0x100)
|
||||
if ((long) value > 0xff || (long) value < -0x100)
|
||||
return bfd_reloc_overflow;
|
||||
|
||||
bfd_put_8 (input_bfd, value, hit_data);
|
||||
|
@ -503,7 +498,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
|
|||
value -= offset;
|
||||
value += addend;
|
||||
|
||||
if ((long)value > 0xffff || (long)value < -0x10000)
|
||||
if ((long) value > 0xffff || (long) value < -0x10000)
|
||||
return bfd_reloc_overflow;
|
||||
|
||||
bfd_put_16 (input_bfd, value, hit_data);
|
||||
|
@ -636,7 +631,7 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||
if (r != bfd_reloc_ok)
|
||||
{
|
||||
const char *name;
|
||||
const char *msg = (const char *)0;
|
||||
const char *msg = (const char *) 0;
|
||||
|
||||
if (h != NULL)
|
||||
name = h->root.root.root.string;
|
||||
|
@ -702,7 +697,7 @@ elf32_mn10300_finish_hash_table_entry (gen_entry, in_args)
|
|||
struct elf32_mn10300_link_hash_entry *entry;
|
||||
unsigned int byte_count = 0;
|
||||
|
||||
entry = (struct elf32_mn10300_link_hash_entry *)gen_entry;
|
||||
entry = (struct elf32_mn10300_link_hash_entry *) gen_entry;
|
||||
|
||||
/* If we already know we want to convert "call" to "calls" for calls
|
||||
to this symbol, then return now. */
|
||||
|
@ -856,7 +851,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
else if (section->_raw_size != 0)
|
||||
{
|
||||
/* Go get them off disk. */
|
||||
contents = (bfd_byte *)bfd_malloc (section->_raw_size);
|
||||
contents = (bfd_byte *) bfd_malloc (section->_raw_size);
|
||||
if (contents == NULL)
|
||||
goto error_return;
|
||||
free_contents = contents;
|
||||
|
@ -899,7 +894,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
r_type = ELF32_R_TYPE (irel->r_info);
|
||||
r_index = ELF32_R_SYM (irel->r_info);
|
||||
|
||||
if (r_type < 0 || r_type >= (int)R_MN10300_MAX)
|
||||
if (r_type < 0 || r_type >= (int) R_MN10300_MAX)
|
||||
goto error_return;
|
||||
|
||||
/* We need the name and hash table entry of the target
|
||||
|
@ -944,7 +939,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
if (new_name == 0)
|
||||
goto error_return;
|
||||
|
||||
sprintf (new_name, "%s_%08x", sym_name, (int)sym_sec);
|
||||
sprintf (new_name, "%s_%08x",
|
||||
sym_name, (int) sym_sec);
|
||||
sym_name = new_name;
|
||||
|
||||
hash = (struct elf32_mn10300_link_hash_entry *)
|
||||
|
@ -1024,7 +1020,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
if (new_name == 0)
|
||||
goto error_return;
|
||||
|
||||
sprintf (new_name, "%s_%08x", sym_name, (int)sym_sec);
|
||||
sprintf (new_name, "%s_%08x",
|
||||
sym_name, (int) sym_sec);
|
||||
sym_name = new_name;
|
||||
|
||||
hash = (struct elf32_mn10300_link_hash_entry *)
|
||||
|
@ -1167,7 +1164,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
else
|
||||
{
|
||||
/* Go get them off disk. */
|
||||
contents = (bfd_byte *)bfd_malloc (section->_raw_size);
|
||||
contents = (bfd_byte *) bfd_malloc (section->_raw_size);
|
||||
if (contents == NULL)
|
||||
goto error_return;
|
||||
free_contents = contents;
|
||||
|
@ -1218,7 +1215,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
new_name = bfd_malloc (strlen (sym_name) + 10);
|
||||
if (new_name == 0)
|
||||
goto error_return;
|
||||
sprintf (new_name, "%s_%08x", sym_name, (int)sym_sec);
|
||||
sprintf (new_name, "%s_%08x", sym_name, (int) sym_sec);
|
||||
sym_name = new_name;
|
||||
|
||||
sym_hash = (struct elf32_mn10300_link_hash_entry *)
|
||||
|
@ -1242,7 +1239,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
elf_section_data (section)->this_hdr.contents = contents;
|
||||
free_contents = NULL;
|
||||
|
||||
symtab_hdr->contents = (bfd_byte *)extsyms;
|
||||
symtab_hdr->contents = (bfd_byte *) extsyms;
|
||||
free_extsyms = NULL;
|
||||
|
||||
/* Count how many bytes we're going to delete. */
|
||||
|
@ -1299,7 +1296,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
elf_section_data (section)->this_hdr.contents = contents;
|
||||
free_contents = NULL;
|
||||
|
||||
symtab_hdr->contents = (bfd_byte *)extsyms;
|
||||
symtab_hdr->contents = (bfd_byte *) extsyms;
|
||||
free_extsyms = NULL;
|
||||
|
||||
/* Count how many bytes we're going to delete. */
|
||||
|
@ -1489,7 +1486,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
new_name = bfd_malloc (strlen (sym_name) + 10);
|
||||
if (new_name == 0)
|
||||
goto error_return;
|
||||
sprintf (new_name, "%s_%08x", sym_name, (int)sym_sec);
|
||||
sprintf (new_name, "%s_%08x", sym_name, (int) sym_sec);
|
||||
sym_name = new_name;
|
||||
|
||||
h = (struct elf32_mn10300_link_hash_entry *)
|
||||
|
@ -1603,7 +1600,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
/* See if the value will fit in 16 bits, note the high value is
|
||||
0x7fff + 2 as the target will be two bytes closer if we are
|
||||
able to relax. */
|
||||
if ((long)value < 0x8001 && (long)value > -0x8000)
|
||||
if ((long) value < 0x8001 && (long) value > -0x8000)
|
||||
{
|
||||
unsigned char code;
|
||||
|
||||
|
@ -1718,7 +1715,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
/* See if the value will fit in 8 bits, note the high value is
|
||||
0x7f + 1 as the target will be one bytes closer if we are
|
||||
able to relax. */
|
||||
if ((long)value < 0x80 && (long)value > -0x80)
|
||||
if ((long) value < 0x80 && (long) value > -0x80)
|
||||
{
|
||||
unsigned char code;
|
||||
|
||||
|
@ -1908,7 +1905,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
value += irel->r_addend;
|
||||
|
||||
/* See if the value will fit in 8 bits. */
|
||||
if ((long)value < 0x7f && (long)value > -0x80)
|
||||
if ((long) value < 0x7f && (long) value > -0x80)
|
||||
{
|
||||
unsigned char code;
|
||||
|
||||
|
@ -1953,8 +1950,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
bfd_put_8 (abfd, code, contents + irel->r_offset - 2);
|
||||
|
||||
/* Fix the relocation's type. */
|
||||
irel->r_info
|
||||
= ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
|
||||
irel->r_info =
|
||||
ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
|
||||
R_MN10300_8);
|
||||
|
||||
/* Delete two bytes of data. */
|
||||
|
@ -1969,7 +1966,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1984,7 +1980,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
/* See if the value will fit in 24 bits.
|
||||
We allow any 16bit match here. We prune those we can't
|
||||
handle below. */
|
||||
if ((long)value < 0x7fffff && (long)value > -0x800000)
|
||||
if ((long) value < 0x7fffff && (long) value > -0x800000)
|
||||
{
|
||||
unsigned char code;
|
||||
|
||||
|
@ -2030,8 +2026,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
bfd_put_8 (abfd, code, contents + irel->r_offset - 2);
|
||||
|
||||
/* Fix the relocation's type. */
|
||||
irel->r_info
|
||||
= ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
|
||||
irel->r_info =
|
||||
ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
|
||||
R_MN10300_24);
|
||||
|
||||
/* Delete one byte of data. */
|
||||
|
@ -2046,14 +2042,13 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* See if the value will fit in 16 bits.
|
||||
We allow any 16bit match here. We prune those we can't
|
||||
handle below. */
|
||||
if ((long)value < 0x7fff && (long)value > -0x8000)
|
||||
if ((long) value < 0x7fff && (long) value > -0x8000)
|
||||
{
|
||||
unsigned char code;
|
||||
|
||||
|
|
Loading…
Reference in New Issue