* config/obj-elf.c: Convert to C90, remove unneeded prototypes and

casts.  Formatting.
	* config/obj-elf.h: Remove PARAMS.
This commit is contained in:
Alan Modra
2003-12-13 12:57:40 +00:00
parent 13c5698440
commit dbe2df79e9
3 changed files with 142 additions and 214 deletions

View File

@ -1,5 +1,9 @@
2003-12-13 Alan Modra <amodra@bigpond.net.au> 2003-12-13 Alan Modra <amodra@bigpond.net.au>
* config/obj-elf.c: Convert to C90, remove unneeded prototypes and
casts. Formatting.
* config/obj-elf.h: Remove PARAMS.
* read.c (s_lcomm_internal): Make global. * read.c (s_lcomm_internal): Make global.
* read.h (s_lcomm_internal): Declare. * read.h (s_lcomm_internal): Declare.
* config/obj-elf.c (elf_pseudo_table): Handle lcomm. * config/obj-elf.c (elf_pseudo_table): Handle lcomm.

View File

@ -53,38 +53,17 @@
#include "elf/i370.h" #include "elf/i370.h"
#endif #endif
static bfd_vma elf_s_get_size PARAMS ((symbolS *)); static void obj_elf_line (int);
static void elf_s_set_size PARAMS ((symbolS *, bfd_vma)); static void obj_elf_size (int);
static bfd_vma elf_s_get_align PARAMS ((symbolS *)); static void obj_elf_type (int);
static void elf_s_set_align PARAMS ((symbolS *, bfd_vma)); static void obj_elf_ident (int);
static void elf_s_set_other PARAMS ((symbolS *, int)); static void obj_elf_weak (int);
static int elf_sec_sym_ok_for_reloc PARAMS ((asection *)); static void obj_elf_local (int);
static void adjust_stab_sections PARAMS ((bfd *, asection *, PTR)); static void obj_elf_visibility (int);
static void build_group_lists PARAMS ((bfd *, asection *, PTR)); static void obj_elf_symver (int);
static int elf_separate_stab_sections PARAMS ((void)); static void obj_elf_subsection (int);
static void elf_init_stab_section PARAMS ((segT)); static void obj_elf_popsection (int);
static void obj_elf_tls_common (int);
#ifdef NEED_ECOFF_DEBUG
static bfd_boolean elf_get_extr PARAMS ((asymbol *, EXTR *));
static void elf_set_index PARAMS ((asymbol *, bfd_size_type));
#endif
static void obj_elf_line PARAMS ((int));
void obj_elf_version PARAMS ((int));
static void obj_elf_size PARAMS ((int));
static void obj_elf_type PARAMS ((int));
static void obj_elf_ident PARAMS ((int));
static void obj_elf_weak PARAMS ((int));
static void obj_elf_local PARAMS ((int));
static void obj_elf_visibility PARAMS ((int));
static int obj_elf_parse_section_letters PARAMS ((char *, size_t));
static int obj_elf_section_word PARAMS ((char *, size_t));
static char *obj_elf_section_name PARAMS ((void));
static int obj_elf_section_type PARAMS ((char *, size_t));
static void obj_elf_symver PARAMS ((int));
static void obj_elf_subsection PARAMS ((int));
static void obj_elf_popsection PARAMS ((int));
static void obj_elf_tls_common PARAMS ((int));
static void obj_elf_lcomm (int); static void obj_elf_lcomm (int);
static const pseudo_typeS elf_pseudo_table[] = static const pseudo_typeS elf_pseudo_table[] =
@ -121,15 +100,15 @@ static const pseudo_typeS elf_pseudo_table[] =
{"subsection", obj_elf_subsection, 0}, {"subsection", obj_elf_subsection, 0},
/* These are GNU extensions to aid in garbage collecting C++ vtables. */ /* These are GNU extensions to aid in garbage collecting C++ vtables. */
{"vtable_inherit", (void (*) PARAMS ((int))) &obj_elf_vtable_inherit, 0}, {"vtable_inherit", (void (*) (int)) &obj_elf_vtable_inherit, 0},
{"vtable_entry", (void (*) PARAMS ((int))) &obj_elf_vtable_entry, 0}, {"vtable_entry", (void (*) (int)) &obj_elf_vtable_entry, 0},
/* These are used for dwarf. */ /* These are used for dwarf. */
{"2byte", cons, 2}, {"2byte", cons, 2},
{"4byte", cons, 4}, {"4byte", cons, 4},
{"8byte", cons, 8}, {"8byte", cons, 8},
/* These are used for dwarf2. */ /* These are used for dwarf2. */
{ "file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 }, { "file", (void (*) (int)) dwarf2_directive_file, 0 },
{ "loc", dwarf2_directive_loc, 0 }, { "loc", dwarf2_directive_loc, 0 },
/* We need to trap the section changing calls to handle .previous. */ /* We need to trap the section changing calls to handle .previous. */
@ -193,19 +172,21 @@ static const pseudo_typeS ecoff_debug_pseudo_table[] =
/* This is called when the assembler starts. */ /* This is called when the assembler starts. */
void void
elf_begin () elf_begin (void)
{ {
asection *s;
/* Add symbols for the known sections to the symbol table. */ /* Add symbols for the known sections to the symbol table. */
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput, s = bfd_get_section_by_name (stdoutput, TEXT_SECTION_NAME);
TEXT_SECTION_NAME))); symbol_table_insert (section_symbol (s));
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput, s = bfd_get_section_by_name (stdoutput, DATA_SECTION_NAME);
DATA_SECTION_NAME))); symbol_table_insert (section_symbol (s));
symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput, s = bfd_get_section_by_name (stdoutput, BSS_SECTION_NAME);
BSS_SECTION_NAME))); symbol_table_insert (section_symbol (s));
} }
void void
elf_pop_insert () elf_pop_insert (void)
{ {
pop_insert (elf_pseudo_table); pop_insert (elf_pseudo_table);
if (ECOFF_DEBUGGING) if (ECOFF_DEBUGGING)
@ -213,64 +194,53 @@ elf_pop_insert ()
} }
static bfd_vma static bfd_vma
elf_s_get_size (sym) elf_s_get_size (symbolS *sym)
symbolS *sym;
{ {
return S_GET_SIZE (sym); return S_GET_SIZE (sym);
} }
static void static void
elf_s_set_size (sym, sz) elf_s_set_size (symbolS *sym, bfd_vma sz)
symbolS *sym;
bfd_vma sz;
{ {
S_SET_SIZE (sym, sz); S_SET_SIZE (sym, sz);
} }
static bfd_vma static bfd_vma
elf_s_get_align (sym) elf_s_get_align (symbolS *sym)
symbolS *sym;
{ {
return S_GET_ALIGN (sym); return S_GET_ALIGN (sym);
} }
static void static void
elf_s_set_align (sym, align) elf_s_set_align (symbolS *sym, bfd_vma align)
symbolS *sym;
bfd_vma align;
{ {
S_SET_ALIGN (sym, align); S_SET_ALIGN (sym, align);
} }
int int
elf_s_get_other (sym) elf_s_get_other (symbolS *sym)
symbolS *sym;
{ {
return elf_symbol (symbol_get_bfdsym (sym))->internal_elf_sym.st_other; return elf_symbol (symbol_get_bfdsym (sym))->internal_elf_sym.st_other;
} }
static void static void
elf_s_set_other (sym, other) elf_s_set_other (symbolS *sym, int other)
symbolS *sym;
int other;
{ {
S_SET_OTHER (sym, other); S_SET_OTHER (sym, other);
} }
static int static int
elf_sec_sym_ok_for_reloc (sec) elf_sec_sym_ok_for_reloc (asection *sec)
asection *sec;
{ {
return obj_sec_sym_ok_for_reloc (sec); return obj_sec_sym_ok_for_reloc (sec);
} }
void void
elf_file_symbol (s) elf_file_symbol (const char *s)
const char *s;
{ {
symbolS *sym; symbolS *sym;
sym = symbol_new (s, absolute_section, (valueT) 0, (struct frag *) 0); sym = symbol_new (s, absolute_section, 0, NULL);
symbol_set_frag (sym, &zero_address_frag); symbol_set_frag (sym, &zero_address_frag);
symbol_get_bfdsym (sym)->flags |= BSF_FILE; symbol_get_bfdsym (sym)->flags |= BSF_FILE;
@ -364,8 +334,7 @@ elf_common_parse (int ignore ATTRIBUTE_UNUSED, symbolS *symbolP, addressT size)
} }
void void
obj_elf_common (is_common) obj_elf_common (int is_common)
int is_common;
{ {
if (flag_mri && is_common) if (flag_mri && is_common)
s_mri_common (0); s_mri_common (0);
@ -374,8 +343,7 @@ obj_elf_common (is_common)
} }
static void static void
obj_elf_tls_common (ignore) obj_elf_tls_common (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
symbolS *symbolP = s_comm_internal (0, elf_common_parse); symbolS *symbolP = s_comm_internal (0, elf_common_parse);
@ -393,8 +361,7 @@ obj_elf_lcomm (int ignore ATTRIBUTE_UNUSED)
} }
static void static void
obj_elf_local (ignore) obj_elf_local (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
int c; int c;
@ -422,8 +389,7 @@ obj_elf_local (ignore)
} }
static void static void
obj_elf_weak (ignore) obj_elf_weak (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
int c; int c;
@ -451,8 +417,7 @@ obj_elf_weak (ignore)
} }
static void static void
obj_elf_visibility (visibility) obj_elf_visibility (int visibility)
int visibility;
{ {
char *name; char *name;
int c; int c;
@ -523,14 +488,13 @@ static struct section_stack *section_stack;
BFD doesn't really let us set the section type. */ BFD doesn't really let us set the section type. */
void void
obj_elf_change_section (name, type, attr, entsize, group_name, linkonce, push) obj_elf_change_section (const char *name,
const char *name; int type,
int type; int attr,
int attr; int entsize,
int entsize; const char *group_name,
const char *group_name; int linkonce,
int linkonce; int push)
int push;
{ {
asection *old_sec; asection *old_sec;
segT sec; segT sec;
@ -691,9 +655,7 @@ obj_elf_change_section (name, type, attr, entsize, group_name, linkonce, push)
} }
static int static int
obj_elf_parse_section_letters (str, len) obj_elf_parse_section_letters (char *str, size_t len)
char *str;
size_t len;
{ {
int attr = 0; int attr = 0;
@ -754,9 +716,7 @@ obj_elf_parse_section_letters (str, len)
} }
static int static int
obj_elf_section_word (str, len) obj_elf_section_word (char *str, size_t len)
char *str;
size_t len;
{ {
if (len == 5 && strncmp (str, "write", 5) == 0) if (len == 5 && strncmp (str, "write", 5) == 0)
return SHF_WRITE; return SHF_WRITE;
@ -780,9 +740,7 @@ obj_elf_section_word (str, len)
} }
static int static int
obj_elf_section_type (str, len) obj_elf_section_type (char *str, size_t len)
char *str;
size_t len;
{ {
if (len == 8 && strncmp (str, "progbits", 8) == 0) if (len == 8 && strncmp (str, "progbits", 8) == 0)
return SHT_PROGBITS; return SHT_PROGBITS;
@ -805,7 +763,7 @@ obj_elf_section_type (str, len)
/* Get name of section. */ /* Get name of section. */
static char * static char *
obj_elf_section_name () obj_elf_section_name (void)
{ {
char *name; char *name;
@ -847,8 +805,7 @@ obj_elf_section_name ()
} }
void void
obj_elf_section (push) obj_elf_section (int push)
int push;
{ {
char *name, *group_name, *beg; char *name, *group_name, *beg;
int type, attr, dummy; int type, attr, dummy;
@ -1006,8 +963,7 @@ obj_elf_section (push)
/* Change to the .data section. */ /* Change to the .data section. */
void void
obj_elf_data (i) obj_elf_data (int i)
int i;
{ {
#ifdef md_flush_pending_output #ifdef md_flush_pending_output
md_flush_pending_output (); md_flush_pending_output ();
@ -1025,8 +981,7 @@ obj_elf_data (i)
/* Change to the .text section. */ /* Change to the .text section. */
void void
obj_elf_text (i) obj_elf_text (int i)
int i;
{ {
#ifdef md_flush_pending_output #ifdef md_flush_pending_output
md_flush_pending_output (); md_flush_pending_output ();
@ -1042,8 +997,7 @@ obj_elf_text (i)
} }
static void static void
obj_elf_subsection (ignore) obj_elf_subsection (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
register int temp; register int temp;
@ -1067,15 +1021,14 @@ obj_elf_subsection (ignore)
sections. */ sections. */
void void
obj_elf_section_change_hook () obj_elf_section_change_hook (void)
{ {
previous_section = now_seg; previous_section = now_seg;
previous_subsection = now_subseg; previous_subsection = now_subseg;
} }
void void
obj_elf_previous (ignore) obj_elf_previous (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
segT new_section; segT new_section;
int new_subsection; int new_subsection;
@ -1102,8 +1055,7 @@ obj_elf_previous (ignore)
} }
static void static void
obj_elf_popsection (xxx) obj_elf_popsection (int xxx ATTRIBUTE_UNUSED)
int xxx ATTRIBUTE_UNUSED;
{ {
struct section_stack *top = section_stack; struct section_stack *top = section_stack;
@ -1129,12 +1081,11 @@ obj_elf_popsection (xxx)
} }
static void static void
obj_elf_line (ignore) obj_elf_line (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
/* Assume delimiter is part of expression. BSD4.2 as fails with /* Assume delimiter is part of expression. BSD4.2 as fails with
delightful bug, so we are not being incompatible here. */ delightful bug, so we are not being incompatible here. */
new_logical_line ((char *) NULL, (int) (get_absolute_expression ())); new_logical_line (NULL, get_absolute_expression ());
demand_empty_rest_of_line (); demand_empty_rest_of_line ();
} }
@ -1145,8 +1096,7 @@ obj_elf_line (ignore)
with the same value as the symbol NAME. */ with the same value as the symbol NAME. */
static void static void
obj_elf_symver (ignore) obj_elf_symver (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
char c; char c;
@ -1216,8 +1166,7 @@ obj_elf_symver (ignore)
syntax is ".vtable_inherit CHILDNAME, PARENTNAME". */ syntax is ".vtable_inherit CHILDNAME, PARENTNAME". */
struct fix * struct fix *
obj_elf_vtable_inherit (ignore) obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *cname, *pname; char *cname, *pname;
symbolS *csym, *psym; symbolS *csym, *psym;
@ -1288,8 +1237,7 @@ obj_elf_vtable_inherit (ignore)
".vtable_entry tablename, offset". */ ".vtable_entry tablename, offset". */
struct fix * struct fix *
obj_elf_vtable_entry (ignore) obj_elf_vtable_entry (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
symbolS *sym; symbolS *sym;
@ -1325,7 +1273,7 @@ obj_elf_vtable_entry (ignore)
} }
void void
elf_obj_read_begin_hook () elf_obj_read_begin_hook (void)
{ {
#ifdef NEED_ECOFF_DEBUG #ifdef NEED_ECOFF_DEBUG
if (ECOFF_DEBUGGING) if (ECOFF_DEBUGGING)
@ -1334,8 +1282,7 @@ elf_obj_read_begin_hook ()
} }
void void
elf_obj_symbol_new_hook (symbolP) elf_obj_symbol_new_hook (symbolS *symbolP)
symbolS *symbolP;
{ {
struct elf_obj_sy *sy_obj; struct elf_obj_sy *sy_obj;
@ -1354,16 +1301,14 @@ elf_obj_symbol_new_hook (symbolP)
context. */ context. */
void void
elf_copy_symbol_attributes (dest, src) elf_copy_symbol_attributes (symbolS *dest, symbolS *src)
symbolS *dest, *src;
{ {
struct elf_obj_sy *srcelf = symbol_get_obj (src); struct elf_obj_sy *srcelf = symbol_get_obj (src);
struct elf_obj_sy *destelf = symbol_get_obj (dest); struct elf_obj_sy *destelf = symbol_get_obj (dest);
if (srcelf->size) if (srcelf->size)
{ {
if (destelf->size == NULL) if (destelf->size == NULL)
destelf->size = destelf->size = xmalloc (sizeof (expressionS));
(expressionS *) xmalloc (sizeof (expressionS));
*destelf->size = *srcelf->size; *destelf->size = *srcelf->size;
} }
else else
@ -1379,8 +1324,7 @@ elf_copy_symbol_attributes (dest, src)
} }
void void
obj_elf_version (ignore) obj_elf_version (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
unsigned int c; unsigned int c;
@ -1389,7 +1333,7 @@ obj_elf_version (ignore)
subsegT subseg = now_subseg; subsegT subseg = now_subseg;
Elf_Internal_Note i_note; Elf_Internal_Note i_note;
Elf_External_Note e_note; Elf_External_Note e_note;
asection *note_secp = (asection *) NULL; asection *note_secp = NULL;
int len; int len;
SKIP_WHITESPACE (); SKIP_WHITESPACE ();
@ -1420,11 +1364,11 @@ obj_elf_version (ignore)
i_note.descsz = 0; /* no description */ i_note.descsz = 0; /* no description */
i_note.type = NT_VERSION; i_note.type = NT_VERSION;
p = frag_more (sizeof (e_note.namesz)); p = frag_more (sizeof (e_note.namesz));
md_number_to_chars (p, (valueT) i_note.namesz, sizeof (e_note.namesz)); md_number_to_chars (p, i_note.namesz, sizeof (e_note.namesz));
p = frag_more (sizeof (e_note.descsz)); p = frag_more (sizeof (e_note.descsz));
md_number_to_chars (p, (valueT) i_note.descsz, sizeof (e_note.descsz)); md_number_to_chars (p, i_note.descsz, sizeof (e_note.descsz));
p = frag_more (sizeof (e_note.type)); p = frag_more (sizeof (e_note.type));
md_number_to_chars (p, (valueT) i_note.type, sizeof (e_note.type)); md_number_to_chars (p, i_note.type, sizeof (e_note.type));
p = frag_more (len + 1); p = frag_more (len + 1);
strcpy (p, name); strcpy (p, name);
@ -1440,8 +1384,7 @@ obj_elf_version (ignore)
} }
static void static void
obj_elf_size (ignore) obj_elf_size (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name = input_line_pointer; char *name = input_line_pointer;
char c = get_symbol_end (); char c = get_symbol_end ();
@ -1482,8 +1425,7 @@ obj_elf_size (ignore)
} }
else else
{ {
symbol_get_obj (sym)->size = symbol_get_obj (sym)->size = xmalloc (sizeof (expressionS));
(expressionS *) xmalloc (sizeof (expressionS));
*symbol_get_obj (sym)->size = exp; *symbol_get_obj (sym)->size = exp;
} }
demand_empty_rest_of_line (); demand_empty_rest_of_line ();
@ -1505,8 +1447,7 @@ obj_elf_size (ignore)
*/ */
static void static void
obj_elf_type (ignore) obj_elf_type (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
char c; char c;
@ -1566,8 +1507,7 @@ obj_elf_type (ignore)
} }
static void static void
obj_elf_ident (ignore) obj_elf_ident (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
static segT comment_section; static segT comment_section;
segT old_section = now_seg; segT old_section = now_seg;
@ -1597,8 +1537,7 @@ obj_elf_ident (ignore)
/* The first entry in a .stabs section is special. */ /* The first entry in a .stabs section is special. */
void void
obj_elf_init_stab_section (seg) obj_elf_init_stab_section (segT seg)
segT seg;
{ {
char *file; char *file;
char *p; char *p;
@ -1613,8 +1552,8 @@ obj_elf_init_stab_section (seg)
p = frag_more (12); p = frag_more (12);
/* Zero it out. */ /* Zero it out. */
memset (p, 0, 12); memset (p, 0, 12);
as_where (&file, (unsigned int *) NULL); as_where (&file, NULL);
stabstr_name = (char *) xmalloc (strlen (segment_name (seg)) + 4); stabstr_name = xmalloc (strlen (segment_name (seg)) + 4);
strcpy (stabstr_name, segment_name (seg)); strcpy (stabstr_name, segment_name (seg));
strcat (stabstr_name, "str"); strcat (stabstr_name, "str");
stroff = get_stab_string_offset (file, stabstr_name); stroff = get_stab_string_offset (file, stabstr_name);
@ -1628,10 +1567,7 @@ obj_elf_init_stab_section (seg)
/* Fill in the counts in the first entry in a .stabs section. */ /* Fill in the counts in the first entry in a .stabs section. */
static void static void
adjust_stab_sections (abfd, sec, xxx) adjust_stab_sections (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
bfd *abfd;
asection *sec;
PTR xxx ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
asection *strsec; asection *strsec;
@ -1643,7 +1579,7 @@ adjust_stab_sections (abfd, sec, xxx)
if (!strcmp ("str", sec->name + strlen (sec->name) - 3)) if (!strcmp ("str", sec->name + strlen (sec->name) - 3))
return; return;
name = (char *) alloca (strlen (sec->name) + 4); name = alloca (strlen (sec->name) + 4);
strcpy (name, sec->name); strcpy (name, sec->name);
strcat (name, "str"); strcat (name, "str");
strsec = bfd_get_section_by_name (abfd, name); strsec = bfd_get_section_by_name (abfd, name);
@ -1656,8 +1592,8 @@ adjust_stab_sections (abfd, sec, xxx)
p = seg_info (sec)->stabu.p; p = seg_info (sec)->stabu.p;
assert (p != 0); assert (p != 0);
bfd_h_put_16 (abfd, (bfd_vma) nsyms, (bfd_byte *) p + 6); bfd_h_put_16 (abfd, nsyms, p + 6);
bfd_h_put_32 (abfd, (bfd_vma) strsz, (bfd_byte *) p + 8); bfd_h_put_32 (abfd, strsz, p + 8);
} }
#ifdef NEED_ECOFF_DEBUG #ifdef NEED_ECOFF_DEBUG
@ -1669,11 +1605,9 @@ adjust_stab_sections (abfd, sec, xxx)
in the symbol. */ in the symbol. */
void void
elf_ecoff_set_ext (sym, ext) elf_ecoff_set_ext (symbolS *sym, struct ecoff_extr *ext)
symbolS *sym;
struct ecoff_extr *ext;
{ {
symbol_get_bfdsym (sym)->udata.p = (PTR) ext; symbol_get_bfdsym (sym)->udata.p = ext;
} }
/* This function is called by bfd_ecoff_debug_externals. It is /* This function is called by bfd_ecoff_debug_externals. It is
@ -1681,9 +1615,7 @@ elf_ecoff_set_ext (sym, ext)
whether the symbol should be used at all. */ whether the symbol should be used at all. */
static bfd_boolean static bfd_boolean
elf_get_extr (sym, ext) elf_get_extr (asymbol *sym, EXTR *ext)
asymbol *sym;
EXTR *ext;
{ {
if (sym->udata.p == NULL) if (sym->udata.p == NULL)
return FALSE; return FALSE;
@ -1695,18 +1627,15 @@ elf_get_extr (sym, ext)
nothing to do for ELF. */ nothing to do for ELF. */
static void static void
elf_set_index (sym, indx) elf_set_index (asymbol *sym ATTRIBUTE_UNUSED,
asymbol *sym ATTRIBUTE_UNUSED; bfd_size_type indx ATTRIBUTE_UNUSED)
bfd_size_type indx ATTRIBUTE_UNUSED;
{ {
} }
#endif /* NEED_ECOFF_DEBUG */ #endif /* NEED_ECOFF_DEBUG */
void void
elf_frob_symbol (symp, puntp) elf_frob_symbol (symbolS *symp, int *puntp)
symbolS *symp;
int *puntp;
{ {
struct elf_obj_sy *sy_obj; struct elf_obj_sy *sy_obj;
@ -1773,14 +1702,14 @@ elf_frob_symbol (symp, puntp)
} }
else else
{ {
if (p [1] == ELF_VER_CHR && p [2] == ELF_VER_CHR) if (p[1] == ELF_VER_CHR && p[2] == ELF_VER_CHR)
{ {
size_t l; size_t l;
/* The @@@ syntax is a special case. It renames the /* The @@@ syntax is a special case. It renames the
symbol name to versioned_name with one `@' removed. */ symbol name to versioned_name with one `@' removed. */
l = strlen (&p[3]) + 1; l = strlen (&p[3]) + 1;
memmove (&p [2], &p[3], l); memmove (&p[2], &p[3], l);
S_SET_NAME (symp, sy_obj->versioned_name); S_SET_NAME (symp, sy_obj->versioned_name);
} }
else else
@ -1872,12 +1801,9 @@ struct group_list
each list. */ each list. */
static void static void
build_group_lists (abfd, sec, inf) build_group_lists (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *inf)
bfd *abfd ATTRIBUTE_UNUSED;
asection *sec;
PTR inf;
{ {
struct group_list *list = (struct group_list *) inf; struct group_list *list = inf;
const char *group_name = elf_group_name (sec); const char *group_name = elf_group_name (sec);
unsigned int i; unsigned int i;
@ -1913,18 +1839,18 @@ build_group_lists (abfd, sec, inf)
} }
void void
elf_frob_file () elf_frob_file (void)
{ {
struct group_list list; struct group_list list;
unsigned int i; unsigned int i;
bfd_map_over_sections (stdoutput, adjust_stab_sections, (PTR) 0); bfd_map_over_sections (stdoutput, adjust_stab_sections, NULL);
/* Go find section groups. */ /* Go find section groups. */
list.num_group = 0; list.num_group = 0;
list.head = NULL; list.head = NULL;
list.elt_count = NULL; list.elt_count = NULL;
bfd_map_over_sections (stdoutput, build_group_lists, (PTR) &list); bfd_map_over_sections (stdoutput, build_group_lists, &list);
/* Make the SHT_GROUP sections that describe each section group. We /* Make the SHT_GROUP sections that describe each section group. We
can't set up the section contents here yet, because elf section can't set up the section contents here yet, because elf section
@ -1991,7 +1917,7 @@ elf_frob_file ()
/* It removes any unneeded versioned symbols from the symbol table. */ /* It removes any unneeded versioned symbols from the symbol table. */
void void
elf_frob_file_before_adjust () elf_frob_file_before_adjust (void)
{ {
if (symbol_rootP) if (symbol_rootP)
{ {
@ -2011,10 +1937,10 @@ elf_frob_file_before_adjust ()
p = strchr (symbol_get_obj (symp)->versioned_name, p = strchr (symbol_get_obj (symp)->versioned_name,
ELF_VER_CHR); ELF_VER_CHR);
know (p != NULL); know (p != NULL);
if (p [1] == ELF_VER_CHR && p [2] == ELF_VER_CHR) if (p[1] == ELF_VER_CHR && p[2] == ELF_VER_CHR)
{ {
size_t l = strlen (&p[3]) + 1; size_t l = strlen (&p[3]) + 1;
memmove (&p [1], &p[3], l); memmove (&p[1], &p[3], l);
} }
if (symbol_used_p (symp) == 0 if (symbol_used_p (symp) == 0
&& symbol_used_in_reloc_p (symp) == 0) && symbol_used_in_reloc_p (symp) == 0)
@ -2038,7 +1964,7 @@ elf_frob_file_before_adjust ()
have generated the relocation section. */ have generated the relocation section. */
void void
elf_frob_file_after_relocs () elf_frob_file_after_relocs (void)
{ {
#ifdef NEED_ECOFF_DEBUG #ifdef NEED_ECOFF_DEBUG
if (ECOFF_DEBUGGING) if (ECOFF_DEBUGGING)
@ -2051,7 +1977,7 @@ elf_frob_file_after_relocs ()
debug_swap debug_swap
= get_elf_backend_data (stdoutput)->elf_backend_ecoff_debug_swap; = get_elf_backend_data (stdoutput)->elf_backend_ecoff_debug_swap;
know (debug_swap != (const struct ecoff_debug_swap *) NULL); know (debug_swap != NULL);
ecoff_build_debug (&debug.symbolic_header, &buf, debug_swap); ecoff_build_debug (&debug.symbolic_header, &buf, debug_swap);
/* Set up the pointers in debug. */ /* Set up the pointers in debug. */
@ -2059,14 +1985,14 @@ elf_frob_file_after_relocs ()
debug.ptr = (type) (buf + debug.symbolic_header.offset) debug.ptr = (type) (buf + debug.symbolic_header.offset)
SET (line, cbLineOffset, unsigned char *); SET (line, cbLineOffset, unsigned char *);
SET (external_dnr, cbDnOffset, PTR); SET (external_dnr, cbDnOffset, void *);
SET (external_pdr, cbPdOffset, PTR); SET (external_pdr, cbPdOffset, void *);
SET (external_sym, cbSymOffset, PTR); SET (external_sym, cbSymOffset, void *);
SET (external_opt, cbOptOffset, PTR); SET (external_opt, cbOptOffset, void *);
SET (external_aux, cbAuxOffset, union aux_ext *); SET (external_aux, cbAuxOffset, union aux_ext *);
SET (ss, cbSsOffset, char *); SET (ss, cbSsOffset, char *);
SET (external_fdr, cbFdOffset, PTR); SET (external_fdr, cbFdOffset, void *);
SET (external_rfd, cbRfdOffset, PTR); SET (external_rfd, cbRfdOffset, void *);
/* ssext and external_ext are set up just below. */ /* ssext and external_ext are set up just below. */
#undef SET #undef SET
@ -2094,8 +2020,7 @@ elf_frob_file_after_relocs ()
eventually become a call to fwrite, and ISO C prohibits eventually become a call to fwrite, and ISO C prohibits
passing a NULL pointer to a stdio function even if the passing a NULL pointer to a stdio function even if the
pointer will not be used. */ pointer will not be used. */
if (! bfd_set_section_contents (stdoutput, sec, (PTR) buf, if (! bfd_set_section_contents (stdoutput, sec, buf, 0, 0))
(file_ptr) 0, (bfd_size_type) 0))
as_fatal (_("can't start writing .mdebug section: %s"), as_fatal (_("can't start writing .mdebug section: %s"),
bfd_errmsg (bfd_get_error ())); bfd_errmsg (bfd_get_error ()));
@ -2141,7 +2066,7 @@ elf_frob_file_after_relocs ()
#define SCO_MINOR_VERSION 0x1 #define SCO_MINOR_VERSION 0x1
void void
sco_id () sco_id (void)
{ {
char *name; char *name;
@ -2152,7 +2077,7 @@ sco_id ()
subsegT subseg = now_subseg; subsegT subseg = now_subseg;
Elf_Internal_Note i_note; Elf_Internal_Note i_note;
Elf_External_Note e_note; Elf_External_Note e_note;
asection *note_secp = (asection *) NULL; asection *note_secp = NULL;
int i, len; int i, len;
/* create the .note section */ /* create the .note section */
@ -2169,13 +2094,13 @@ sco_id ()
i_note.type = NT_VERSION; /* Contains a version string */ i_note.type = NT_VERSION; /* Contains a version string */
p = frag_more (sizeof (i_note.namesz)); p = frag_more (sizeof (i_note.namesz));
md_number_to_chars (p, (valueT) i_note.namesz, 4); md_number_to_chars (p, i_note.namesz, 4);
p = frag_more (sizeof (i_note.descsz)); p = frag_more (sizeof (i_note.descsz));
md_number_to_chars (p, (valueT) i_note.descsz, 4); md_number_to_chars (p, i_note.descsz, 4);
p = frag_more (sizeof (i_note.type)); p = frag_more (sizeof (i_note.type));
md_number_to_chars (p, (valueT) i_note.type, 4); md_number_to_chars (p, i_note.type, 4);
p = frag_more (4); p = frag_more (4);
strcpy (p, "SCO"); strcpy (p, "SCO");
@ -2208,7 +2133,7 @@ sco_id ()
#endif /* SCO_ELF */ #endif /* SCO_ELF */
static int static int
elf_separate_stab_sections () elf_separate_stab_sections (void)
{ {
#ifdef NEED_ECOFF_DEBUG #ifdef NEED_ECOFF_DEBUG
return (!ECOFF_DEBUGGING); return (!ECOFF_DEBUGGING);
@ -2218,8 +2143,7 @@ elf_separate_stab_sections ()
} }
static void static void
elf_init_stab_section (seg) elf_init_stab_section (segT seg)
segT seg;
{ {
#ifdef NEED_ECOFF_DEBUG #ifdef NEED_ECOFF_DEBUG
if (!ECOFF_DEBUGGING) if (!ECOFF_DEBUGGING)

View File

@ -1,6 +1,6 @@
/* ELF object file format. /* ELF object file format.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
Free Software Foundation, Inc. 2002, 2003 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler. This file is part of GAS, the GNU Assembler.
@ -100,7 +100,7 @@ struct elf_obj_sy
#ifndef obj_begin #ifndef obj_begin
#define obj_begin() elf_begin () #define obj_begin() elf_begin ()
#endif #endif
extern void elf_begin PARAMS ((void)); extern void elf_begin (void);
/* should be conditional on address size! */ /* should be conditional on address size! */
#define elf_symbol(asymbol) ((elf_symbol_type *) (&(asymbol)->the_bfd)) #define elf_symbol(asymbol) ((elf_symbol_type *) (&(asymbol)->the_bfd))
@ -123,7 +123,7 @@ extern void elf_begin PARAMS ((void));
(elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value = (V)) (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value = (V))
#endif #endif
int elf_s_get_other PARAMS ((symbolS *)); int elf_s_get_other (symbolS *);
#ifndef S_GET_OTHER #ifndef S_GET_OTHER
#define S_GET_OTHER(S) (elf_s_get_other (S)) #define S_GET_OTHER(S) (elf_s_get_other (S))
#endif #endif
@ -144,35 +144,35 @@ extern asection *gdb_section;
#ifndef obj_frob_file #ifndef obj_frob_file
#define obj_frob_file elf_frob_file #define obj_frob_file elf_frob_file
#endif #endif
extern void elf_frob_file PARAMS ((void)); extern void elf_frob_file (void);
#ifndef obj_frob_file_before_adjust #ifndef obj_frob_file_before_adjust
#define obj_frob_file_before_adjust elf_frob_file_before_adjust #define obj_frob_file_before_adjust elf_frob_file_before_adjust
#endif #endif
extern void elf_frob_file_before_adjust PARAMS ((void)); extern void elf_frob_file_before_adjust (void);
#ifndef obj_frob_file_after_relocs #ifndef obj_frob_file_after_relocs
#define obj_frob_file_after_relocs elf_frob_file_after_relocs #define obj_frob_file_after_relocs elf_frob_file_after_relocs
#endif #endif
extern void elf_frob_file_after_relocs PARAMS ((void)); extern void elf_frob_file_after_relocs (void);
#ifndef obj_app_file #ifndef obj_app_file
#define obj_app_file elf_file_symbol #define obj_app_file elf_file_symbol
#endif #endif
extern void elf_file_symbol PARAMS ((const char *)); extern void elf_file_symbol (const char *);
extern void obj_elf_section_change_hook PARAMS ((void)); extern void obj_elf_section_change_hook (void);
extern void obj_elf_section PARAMS ((int)); extern void obj_elf_section (int);
extern void obj_elf_previous PARAMS ((int)); extern void obj_elf_previous (int);
extern void obj_elf_version PARAMS ((int)); extern void obj_elf_version (int);
extern void obj_elf_common PARAMS ((int)); extern void obj_elf_common (int);
extern void obj_elf_data PARAMS ((int)); extern void obj_elf_data (int);
extern void obj_elf_text PARAMS ((int)); extern void obj_elf_text (int);
extern void obj_elf_change_section extern void obj_elf_change_section
PARAMS ((const char *, int, int, int, const char *, int, int)); (const char *, int, int, int, const char *, int, int);
extern struct fix *obj_elf_vtable_inherit PARAMS ((int)); extern struct fix *obj_elf_vtable_inherit (int);
extern struct fix *obj_elf_vtable_entry PARAMS ((int)); extern struct fix *obj_elf_vtable_entry (int);
/* BFD wants to write the udata field, which is a no-no for the /* BFD wants to write the udata field, which is a no-no for the
predefined section symbols in bfd/section.c. They are read-only. */ predefined section symbols in bfd/section.c. They are read-only. */
@ -180,17 +180,17 @@ extern struct fix *obj_elf_vtable_entry PARAMS ((int));
#define obj_sec_sym_ok_for_reloc(SEC) ((SEC)->owner != 0) #define obj_sec_sym_ok_for_reloc(SEC) ((SEC)->owner != 0)
#endif #endif
void elf_obj_read_begin_hook PARAMS ((void)); void elf_obj_read_begin_hook (void);
#ifndef obj_read_begin_hook #ifndef obj_read_begin_hook
#define obj_read_begin_hook elf_obj_read_begin_hook #define obj_read_begin_hook elf_obj_read_begin_hook
#endif #endif
void elf_obj_symbol_new_hook PARAMS ((symbolS *)); void elf_obj_symbol_new_hook (symbolS *);
#ifndef obj_symbol_new_hook #ifndef obj_symbol_new_hook
#define obj_symbol_new_hook elf_obj_symbol_new_hook #define obj_symbol_new_hook elf_obj_symbol_new_hook
#endif #endif
void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *)); void elf_copy_symbol_attributes (symbolS *, symbolS *);
#ifndef OBJ_COPY_SYMBOL_ATTRIBUTES #ifndef OBJ_COPY_SYMBOL_ATTRIBUTES
#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \ #define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \
(elf_copy_symbol_attributes (DEST, SRC)) (elf_copy_symbol_attributes (DEST, SRC))
@ -207,7 +207,7 @@ void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *));
/* We need 12 bytes at the start of the section to hold some initial /* We need 12 bytes at the start of the section to hold some initial
information. */ information. */
extern void obj_elf_init_stab_section PARAMS ((segT)); extern void obj_elf_init_stab_section (segT);
#define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg) #define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg)
#ifdef ECOFF_DEBUGGING #ifdef ECOFF_DEBUGGING
@ -229,12 +229,12 @@ extern void obj_elf_init_stab_section PARAMS ((segT));
#endif /* SEPARATE_STAB_SECTIONS not defined. */ #endif /* SEPARATE_STAB_SECTIONS not defined. */
extern void elf_frob_symbol PARAMS ((symbolS *, int *)); extern void elf_frob_symbol (symbolS *, int *);
#ifndef obj_frob_symbol #ifndef obj_frob_symbol
#define obj_frob_symbol(symp, punt) elf_frob_symbol (symp, &punt) #define obj_frob_symbol(symp, punt) elf_frob_symbol (symp, &punt)
#endif #endif
extern void elf_pop_insert PARAMS ((void)); extern void elf_pop_insert (void);
#ifndef obj_pop_insert #ifndef obj_pop_insert
#define obj_pop_insert() elf_pop_insert() #define obj_pop_insert() elf_pop_insert()
#endif #endif
@ -244,7 +244,7 @@ extern void elf_pop_insert PARAMS ((void));
#ifdef ANSI_PROTOTYPES #ifdef ANSI_PROTOTYPES
struct ecoff_extr; struct ecoff_extr;
#endif #endif
extern void elf_ecoff_set_ext PARAMS ((symbolS *, struct ecoff_extr *)); extern void elf_ecoff_set_ext (symbolS *, struct ecoff_extr *);
#endif #endif
#endif /* _OBJ_ELF_H */ #endif /* _OBJ_ELF_H */