mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
Removed usage of alloca, lint.
This commit is contained in:
@ -4,4 +4,3 @@ TDEFINES=-DBFD_HEADERS -DMANY_SEGMENTS -DBFD
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "obstack.h"
|
#include "obstack.h"
|
||||||
#include "subsegs.h"
|
#include "subsegs.h"
|
||||||
#include "frags.h"
|
#include "frags.h"
|
||||||
|
#include "../bfd/libbfd.h"
|
||||||
|
|
||||||
|
|
||||||
/* This vector is used to turn an internal segment into a section #
|
/* This vector is used to turn an internal segment into a section #
|
||||||
@ -108,10 +108,18 @@ static symbolS *EXFUN(tag_find_or_make,(char *name));
|
|||||||
static symbolS* EXFUN(tag_find,(char *name));
|
static symbolS* EXFUN(tag_find,(char *name));
|
||||||
|
|
||||||
|
|
||||||
static void EXFUN(w_symbols,(
|
static int
|
||||||
bfd *abfd ,
|
EXFUN(c_line_new,(
|
||||||
char **where ,
|
symbolS *symbol,
|
||||||
symbolS *symbol_rootP));
|
long paddr,
|
||||||
|
unsigned short line_number,
|
||||||
|
fragS* frag));
|
||||||
|
|
||||||
|
|
||||||
|
static void EXFUN(w_symbols,
|
||||||
|
(bfd *abfd ,
|
||||||
|
char *where ,
|
||||||
|
symbolS *symbol_rootP));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -125,7 +133,6 @@ static void EXFUN( obj_coff_line,(void));
|
|||||||
static void EXFUN( obj_coff_ln,(void));
|
static void EXFUN( obj_coff_ln,(void));
|
||||||
static void EXFUN( obj_coff_scl,(void));
|
static void EXFUN( obj_coff_scl,(void));
|
||||||
static void EXFUN( obj_coff_size,(void));
|
static void EXFUN( obj_coff_size,(void));
|
||||||
static void EXFUN( obj_coff_stab,(int what));
|
|
||||||
static void EXFUN( obj_coff_tag,(void));
|
static void EXFUN( obj_coff_tag,(void));
|
||||||
static void EXFUN( obj_coff_type,(void));
|
static void EXFUN( obj_coff_type,(void));
|
||||||
static void EXFUN( obj_coff_val,(void));
|
static void EXFUN( obj_coff_val,(void));
|
||||||
@ -211,12 +218,10 @@ seg_info_type seg_info_off_by_4[N_SEG] =
|
|||||||
{18},
|
{18},
|
||||||
{19},
|
{19},
|
||||||
{20},
|
{20},
|
||||||
{21},
|
{0},
|
||||||
{22},
|
{0},
|
||||||
{23},
|
{0},
|
||||||
{SEG_REGISTER},0x1111,0x2222,0x3333,0x4444
|
{SEG_REGISTER},0,0,0,0};
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#define SEG_INFO_FROM_SECTION_NUMBER(x) (seg_info_off_by_4[(x)+4])
|
#define SEG_INFO_FROM_SECTION_NUMBER(x) (seg_info_off_by_4[(x)+4])
|
||||||
#define SEG_INFO_FROM_SEG_NUMBER(x) (seg_info_off_by_4[(x)])
|
#define SEG_INFO_FROM_SEG_NUMBER(x) (seg_info_off_by_4[(x)])
|
||||||
@ -251,7 +256,7 @@ static unsigned int DEFUN(size_section,(abfd, idx),
|
|||||||
bfd *abfd AND
|
bfd *abfd AND
|
||||||
unsigned int idx)
|
unsigned int idx)
|
||||||
{
|
{
|
||||||
asection *sec;
|
|
||||||
unsigned int size = 0;
|
unsigned int size = 0;
|
||||||
fragS *frag = segment_info[idx].frchainP->frch_root;
|
fragS *frag = segment_info[idx].frchainP->frch_root;
|
||||||
while (frag) {
|
while (frag) {
|
||||||
@ -311,14 +316,14 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
|
|||||||
unsigned long *file_cursor)
|
unsigned long *file_cursor)
|
||||||
{
|
{
|
||||||
unsigned int nrelocs;
|
unsigned int nrelocs;
|
||||||
arelent **reloc_ptr_vector;
|
|
||||||
arelent *reloc_vector;
|
|
||||||
asymbol **ptrs;
|
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
|
|
||||||
|
|
||||||
unsigned int i;
|
|
||||||
fixS *from;
|
|
||||||
for (idx = SEG_E0; idx < SEG_E9; idx++)
|
for (idx = SEG_E0; idx < SEG_E9; idx++)
|
||||||
{
|
{
|
||||||
if (segment_info[idx].scnhdr.s_name[0])
|
if (segment_info[idx].scnhdr.s_name[0])
|
||||||
@ -333,7 +338,7 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
|
|||||||
nrelocs = count_entries_in_chain(idx);
|
nrelocs = count_entries_in_chain(idx);
|
||||||
external_reloc_size = nrelocs * RELSZ;
|
external_reloc_size = nrelocs * RELSZ;
|
||||||
external_reloc_vec =
|
external_reloc_vec =
|
||||||
(struct external_reloc*)alloca(external_reloc_size);
|
(struct external_reloc*)malloc(external_reloc_size);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -397,8 +402,9 @@ void DEFUN(do_relocs_for,(abfd, file_cursor),
|
|||||||
/* Write out the reloc table */
|
/* Write out the reloc table */
|
||||||
segment_info[idx].scnhdr.s_relptr = *file_cursor;
|
segment_info[idx].scnhdr.s_relptr = *file_cursor;
|
||||||
segment_info[idx].scnhdr.s_nreloc = nrelocs;
|
segment_info[idx].scnhdr.s_nreloc = nrelocs;
|
||||||
bfd_write(external_reloc_vec, 1, external_reloc_size, abfd);
|
bfd_write((PTR)external_reloc_vec, 1, external_reloc_size, abfd);
|
||||||
*file_cursor += external_reloc_size;
|
*file_cursor += external_reloc_size;
|
||||||
|
free( external_reloc_vec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -424,7 +430,7 @@ static void DEFUN(fill_section,(abfd, filehdr, file_cursor),
|
|||||||
|
|
||||||
if (s->s_name[0]) {
|
if (s->s_name[0]) {
|
||||||
fragS *frag = segment_info[i].frchainP->frch_root;
|
fragS *frag = segment_info[i].frchainP->frch_root;
|
||||||
char *buffer = alloca(s->s_size);
|
char *buffer = malloc(s->s_size);
|
||||||
s->s_scnptr = *file_cursor;
|
s->s_scnptr = *file_cursor;
|
||||||
s->s_paddr = paddr;
|
s->s_paddr = paddr;
|
||||||
s->s_vaddr = paddr;
|
s->s_vaddr = paddr;
|
||||||
@ -440,6 +446,7 @@ static void DEFUN(fill_section,(abfd, filehdr, file_cursor),
|
|||||||
while (frag) {
|
while (frag) {
|
||||||
unsigned int fill_size;
|
unsigned int fill_size;
|
||||||
switch (frag->fr_type) {
|
switch (frag->fr_type) {
|
||||||
|
|
||||||
case rs_fill:
|
case rs_fill:
|
||||||
case rs_align:
|
case rs_align:
|
||||||
case rs_org:
|
case rs_org:
|
||||||
@ -472,11 +479,12 @@ static void DEFUN(fill_section,(abfd, filehdr, file_cursor),
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
frag = frag->fr_next;
|
frag = frag->fr_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bfd_write(buffer, s->s_size,1,abfd);
|
bfd_write(buffer, s->s_size,1,abfd);
|
||||||
|
free(buffer);
|
||||||
|
|
||||||
*file_cursor += s->s_size;
|
*file_cursor += s->s_size;
|
||||||
paddr += s->s_size;
|
paddr += s->s_size;
|
||||||
}
|
}
|
||||||
@ -525,37 +533,39 @@ DEFUN(coff_header_append,(abfd, filehdr, aouthdr),
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
char *
|
||||||
DEFUN(symbol_to_chars,(abfd, where, symbolP),
|
DEFUN(symbol_to_chars,(abfd, where, symbolP),
|
||||||
bfd*abfd AND
|
bfd*abfd AND
|
||||||
char **where AND
|
char *where AND
|
||||||
symbolS *symbolP)
|
symbolS *symbolP)
|
||||||
{
|
{
|
||||||
unsigned int numaux = symbolP->sy_symbol.ost_entry.n_numaux;
|
unsigned int numaux = symbolP->sy_symbol.ost_entry.n_numaux;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
/* Turn any symbols with register attributes into abs symbols */
|
/* Turn any symbols with register attributes into abs symbols */
|
||||||
if (S_GET_SEGMENT(symbolP) == SEG_REGISTER)
|
if (S_GET_SEGMENT(symbolP) == SEG_REGISTER)
|
||||||
{
|
{
|
||||||
S_SET_SEGMENT(symbolP, SEG_ABSOLUTE);
|
S_SET_SEGMENT(symbolP, SEG_ABSOLUTE);
|
||||||
}
|
}
|
||||||
/* At the same time, relocate all symbols to their output value */
|
/* At the same time, relocate all symbols to their output value */
|
||||||
|
|
||||||
S_SET_VALUE(symbolP,
|
S_SET_VALUE(symbolP,
|
||||||
segment_info[S_GET_SEGMENT(symbolP)].scnhdr.s_paddr
|
segment_info[S_GET_SEGMENT(symbolP)].scnhdr.s_paddr
|
||||||
+ S_GET_VALUE(symbolP));
|
+ S_GET_VALUE(symbolP));
|
||||||
|
|
||||||
*where += bfd_coff_swap_sym_out(abfd, &symbolP->sy_symbol.ost_entry,
|
where += bfd_coff_swap_sym_out(abfd, &symbolP->sy_symbol.ost_entry,
|
||||||
*where);
|
where);
|
||||||
|
|
||||||
for (i = 0; i < numaux; i++)
|
for (i = 0; i < numaux; i++)
|
||||||
{
|
{
|
||||||
*where += bfd_coff_swap_aux_out(abfd,
|
where += bfd_coff_swap_aux_out(abfd,
|
||||||
&symbolP->sy_symbol.ost_auxent[i],
|
&symbolP->sy_symbol.ost_auxent[i],
|
||||||
S_GET_DATA_TYPE(symbolP),
|
S_GET_DATA_TYPE(symbolP),
|
||||||
S_GET_STORAGE_CLASS(symbolP),
|
S_GET_STORAGE_CLASS(symbolP),
|
||||||
*where);
|
where);
|
||||||
}
|
}
|
||||||
|
return where;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -643,6 +653,7 @@ stack* st;
|
|||||||
st->pointer = 0;
|
st->pointer = 0;
|
||||||
return (char*)0;
|
return (char*)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return st->data + st->pointer;
|
return st->data + st->pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -745,7 +756,7 @@ int what;
|
|||||||
|
|
||||||
unsigned int dim_index;
|
unsigned int dim_index;
|
||||||
static void obj_coff_endef() {
|
static void obj_coff_endef() {
|
||||||
symbolS *symbolP;
|
symbolS *symbolP = 0;
|
||||||
/* DIM BUG FIX sac@cygnus.com */
|
/* DIM BUG FIX sac@cygnus.com */
|
||||||
dim_index =0;
|
dim_index =0;
|
||||||
if (def_symbol_in_progress == NULL) {
|
if (def_symbol_in_progress == NULL) {
|
||||||
@ -878,15 +889,20 @@ static void obj_coff_endef() {
|
|||||||
|
|
||||||
if (SF_GET_FUNCTION(def_symbol_in_progress)) {
|
if (SF_GET_FUNCTION(def_symbol_in_progress)) {
|
||||||
know(sizeof(def_symbol_in_progress) <= sizeof(long));
|
know(sizeof(def_symbol_in_progress) <= sizeof(long));
|
||||||
function_lineoff = c_line_new((long) def_symbol_in_progress,0, 0, &zero_address_frag);
|
function_lineoff
|
||||||
|
= c_line_new((long)
|
||||||
|
def_symbol_in_progress,0, 0, &zero_address_frag);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SF_SET_PROCESS(def_symbol_in_progress);
|
SF_SET_PROCESS(def_symbol_in_progress);
|
||||||
|
|
||||||
if (symbolP == NULL) {
|
if (symbolP == NULL) {
|
||||||
/* That is, if this is the first
|
/* That is, if this is the first
|
||||||
time we've seen the function... */
|
time we've seen the function... */
|
||||||
symbol_table_insert(def_symbol_in_progress);
|
symbol_table_insert(def_symbol_in_progress);
|
||||||
} /* definition follows debug */
|
} /* definition follows debug */
|
||||||
} /* Create the line number entry pointing to the function being defined */
|
} /* Create the line number entry pointing to the function being defined */
|
||||||
|
|
||||||
def_symbol_in_progress = NULL;
|
def_symbol_in_progress = NULL;
|
||||||
demand_empty_rest_of_line();
|
demand_empty_rest_of_line();
|
||||||
@ -1413,8 +1429,8 @@ static void DEFUN(crawl_symbols,(headers, abfd),
|
|||||||
* Find strings by crawling along symbol table chain.
|
* Find strings by crawling along symbol table chain.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
w_strings(where)
|
void DEFUN(w_strings,(where),
|
||||||
char *where;
|
char *where)
|
||||||
{
|
{
|
||||||
symbolS *symbolP;
|
symbolS *symbolP;
|
||||||
|
|
||||||
@ -1430,7 +1446,7 @@ char *where;
|
|||||||
if (SF_GET_STRING(symbolP)) {
|
if (SF_GET_STRING(symbolP)) {
|
||||||
size = strlen(S_GET_NAME(symbolP)) + 1;
|
size = strlen(S_GET_NAME(symbolP)) + 1;
|
||||||
|
|
||||||
memcpy(where, S_GET_NAME(symbolP),size);
|
memcpy(where, S_GET_NAME(symbolP),size);
|
||||||
where += size;
|
where += size;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1441,72 +1457,6 @@ char *where;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* This is a copy from aout. All I do is neglect to actually build the symbol. */
|
|
||||||
|
|
||||||
static void obj_coff_stab(what)
|
|
||||||
int what;
|
|
||||||
{
|
|
||||||
char *string;
|
|
||||||
expressionS e;
|
|
||||||
int goof = 0; /* TRUE if we have aborted. */
|
|
||||||
int length;
|
|
||||||
int saved_type = 0;
|
|
||||||
long longint;
|
|
||||||
symbolS *symbolP = 0;
|
|
||||||
|
|
||||||
if (what == 's') {
|
|
||||||
string = demand_copy_C_string(&length);
|
|
||||||
SKIP_WHITESPACE();
|
|
||||||
|
|
||||||
if (*input_line_pointer == ',') {
|
|
||||||
input_line_pointer++;
|
|
||||||
} else {
|
|
||||||
as_bad("I need a comma after symbol's name");
|
|
||||||
goof = 1;
|
|
||||||
} /* better be a comma */
|
|
||||||
} /* skip the string */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Input_line_pointer->after ','. String->symbol name.
|
|
||||||
*/
|
|
||||||
if (!goof) {
|
|
||||||
if (get_absolute_expression_and_terminator(&longint) != ',') {
|
|
||||||
as_bad("I want a comma after the n_type expression");
|
|
||||||
goof = 1;
|
|
||||||
input_line_pointer--; /* Backup over a non-',' char. */
|
|
||||||
} /* on error */
|
|
||||||
} /* no error */
|
|
||||||
|
|
||||||
if (!goof) {
|
|
||||||
if (get_absolute_expression_and_terminator(&longint) != ',') {
|
|
||||||
as_bad("I want a comma after the n_other expression");
|
|
||||||
goof = 1;
|
|
||||||
input_line_pointer--; /* Backup over a non-',' char. */
|
|
||||||
} /* on error */
|
|
||||||
} /* no error */
|
|
||||||
|
|
||||||
if (!goof) {
|
|
||||||
get_absolute_expression();
|
|
||||||
|
|
||||||
if (what == 's' || what == 'n') {
|
|
||||||
if (*input_line_pointer != ',') {
|
|
||||||
as_bad("I want a comma after the n_desc expression");
|
|
||||||
goof = 1;
|
|
||||||
} else {
|
|
||||||
input_line_pointer++;
|
|
||||||
} /* on goof */
|
|
||||||
} /* not stabd */
|
|
||||||
} /* no error */
|
|
||||||
|
|
||||||
expression(&e);
|
|
||||||
|
|
||||||
if (goof) {
|
|
||||||
ignore_rest_of_line();
|
|
||||||
} else {
|
|
||||||
demand_empty_rest_of_line();
|
|
||||||
} /* on error */
|
|
||||||
} /* obj_coff_stab() */
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DEFUN(do_linenos_for,(abfd, file_cursor),
|
DEFUN(do_linenos_for,(abfd, file_cursor),
|
||||||
@ -1524,7 +1474,7 @@ DEFUN(do_linenos_for,(abfd, file_cursor),
|
|||||||
struct lineno_list *line_ptr ;
|
struct lineno_list *line_ptr ;
|
||||||
|
|
||||||
struct external_lineno *buffer =
|
struct external_lineno *buffer =
|
||||||
(struct external_lineno *)alloca(s->scnhdr.s_nlnno * LINESZ);
|
(struct external_lineno *)xmalloc(s->scnhdr.s_nlnno * LINESZ);
|
||||||
|
|
||||||
struct external_lineno *dst= buffer;
|
struct external_lineno *dst= buffer;
|
||||||
|
|
||||||
@ -1548,6 +1498,8 @@ DEFUN(do_linenos_for,(abfd, file_cursor),
|
|||||||
s->scnhdr.s_lnnoptr = *file_cursor;
|
s->scnhdr.s_lnnoptr = *file_cursor;
|
||||||
|
|
||||||
bfd_write(buffer, 1, s->scnhdr.s_nlnno* LINESZ, abfd);
|
bfd_write(buffer, 1, s->scnhdr.s_nlnno* LINESZ, abfd);
|
||||||
|
free(buffer);
|
||||||
|
|
||||||
*file_cursor += s->scnhdr.s_nlnno * LINESZ;
|
*file_cursor += s->scnhdr.s_nlnno * LINESZ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1590,7 +1542,7 @@ extern void DEFUN_VOID(write_object_file)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct frchain *frchain_ptr;
|
struct frchain *frchain_ptr;
|
||||||
struct frag *frag_ptr;
|
|
||||||
struct internal_filehdr filehdr;
|
struct internal_filehdr filehdr;
|
||||||
struct internal_aouthdr aouthdr;
|
struct internal_aouthdr aouthdr;
|
||||||
unsigned long file_cursor;
|
unsigned long file_cursor;
|
||||||
@ -1692,16 +1644,14 @@ extern void DEFUN_VOID(write_object_file)
|
|||||||
{
|
{
|
||||||
|
|
||||||
unsigned int symtable_size = filehdr.f_nsyms * SYMESZ;
|
unsigned int symtable_size = filehdr.f_nsyms * SYMESZ;
|
||||||
char *buffer1 = alloca(symtable_size);
|
char *buffer1 = malloc(symtable_size + string_byte_count + 4);
|
||||||
char *buffer2 = alloca(string_byte_count+4);
|
|
||||||
char *ptr = buffer1;
|
char *ptr = buffer1;
|
||||||
filehdr.f_symptr = bfd_tell(abfd);
|
filehdr.f_symptr = bfd_tell(abfd);
|
||||||
w_symbols(abfd,&buffer1, symbol_rootP);
|
w_symbols(abfd, buffer1, symbol_rootP);
|
||||||
bfd_write(ptr, 1, symtable_size, abfd);
|
w_strings(buffer1 + symtable_size);
|
||||||
|
bfd_write(buffer1, 1,symtable_size + string_byte_count + 4, abfd);
|
||||||
w_strings(buffer2);
|
free(buffer1);
|
||||||
bfd_write(buffer2, 1, string_byte_count, abfd);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
coff_header_append(abfd, &filehdr, &aouthdr);
|
coff_header_append(abfd, &filehdr, &aouthdr);
|
||||||
|
|
||||||
@ -1798,12 +1748,12 @@ symbolS *normal;
|
|||||||
SF_SET_DEBUG_FIELD(normal, SF_GET_DEBUG_FIELD(debug));
|
SF_SET_DEBUG_FIELD(normal, SF_GET_DEBUG_FIELD(debug));
|
||||||
} /* c_symbol_merge() */
|
} /* c_symbol_merge() */
|
||||||
|
|
||||||
int
|
static int
|
||||||
c_line_new(symbol, paddr, line_number, frag)
|
DEFUN(c_line_new,(symbol, paddr, line_number, frag),
|
||||||
symbolS *symbol;
|
symbolS *symbol AND
|
||||||
long paddr;
|
long paddr AND
|
||||||
unsigned short line_number;
|
unsigned short line_number AND
|
||||||
fragS* frag;
|
fragS* frag)
|
||||||
{
|
{
|
||||||
struct lineno_list* new_line =
|
struct lineno_list* new_line =
|
||||||
(struct lineno_list *)xmalloc(sizeof(struct lineno_list));
|
(struct lineno_list *)xmalloc(sizeof(struct lineno_list));
|
||||||
@ -1887,10 +1837,11 @@ int idx;
|
|||||||
|
|
||||||
return symbolP;
|
return symbolP;
|
||||||
} /* c_section_symbol() */
|
} /* c_section_symbol() */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DEFUN(w_symbols,(abfd, where, symbol_rootP),
|
DEFUN(w_symbols,(abfd, where, symbol_rootP),
|
||||||
bfd *abfd AND
|
bfd *abfd AND
|
||||||
char **where AND
|
char *where AND
|
||||||
symbolS *symbol_rootP)
|
symbolS *symbol_rootP)
|
||||||
{
|
{
|
||||||
symbolS *symbolP;
|
symbolS *symbolP;
|
||||||
@ -1928,9 +1879,10 @@ symbolS *symbol_rootP)
|
|||||||
bzero(symbolP->sy_symbol.ost_entry.n_name, SYMNMLEN);
|
bzero(symbolP->sy_symbol.ost_entry.n_name, SYMNMLEN);
|
||||||
strncpy(symbolP->sy_symbol.ost_entry.n_name, temp, SYMNMLEN);
|
strncpy(symbolP->sy_symbol.ost_entry.n_name, temp, SYMNMLEN);
|
||||||
}
|
}
|
||||||
symbol_to_chars(abfd, where, symbolP);
|
where = symbol_to_chars(abfd, where, symbolP);
|
||||||
S_SET_NAME(symbolP,temp);
|
S_SET_NAME(symbolP,temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* w_symbols() */
|
} /* w_symbols() */
|
||||||
|
|
||||||
static void DEFUN_VOID(obj_coff_lcomm)
|
static void DEFUN_VOID(obj_coff_lcomm)
|
||||||
|
@ -23,11 +23,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
#include "targ-cpu.h"
|
#include "targ-cpu.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef BFD_HEADERS
|
|
||||||
#include "bfd.h"
|
#include "bfd.h"
|
||||||
|
|
||||||
extern bfd *stdoutput;
|
/*extern bfd *stdoutput;*/
|
||||||
/* This internal_lineno crap is to stop namespace pollution from the
|
/* This internal_lineno crap is to stop namespace pollution from the
|
||||||
bfd internal coff headerfile. */
|
bfd internal coff headerfile. */
|
||||||
|
|
||||||
@ -44,21 +42,8 @@ extern bfd *stdoutput;
|
|||||||
#else
|
#else
|
||||||
help me
|
help me
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
#include "coff.gnu.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_NATIVE_HEADERS
|
|
||||||
#include <filehdr.h>
|
|
||||||
#include <aouthdr.h>
|
|
||||||
#include <scnhdr.h>
|
|
||||||
#include <storclass.h>
|
|
||||||
#include <linenum.h>
|
|
||||||
#include <syms.h>
|
|
||||||
#include <reloc.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#endif /* USE_NATIVE_HEADERS */
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* Define some processor dependent values according to the processor we are
|
/* Define some processor dependent values according to the processor we are
|
||||||
on. */
|
on. */
|
||||||
#if defined(TC_H8300)
|
#if defined(TC_H8300)
|
||||||
@ -96,24 +81,18 @@ help me
|
|||||||
you lose
|
you lose
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef OBJ_COFF_MAX_AUXENTRIES
|
#ifndef OBJ_COFF_MAX_AUXENTRIES
|
||||||
#define OBJ_COFF_MAX_AUXENTRIES 1
|
#define OBJ_COFF_MAX_AUXENTRIES 1
|
||||||
#endif /* OBJ_COFF_MAX_AUXENTRIES */
|
#endif /* OBJ_COFF_MAX_AUXENTRIES */
|
||||||
|
|
||||||
/*extern const short seg_N_TYPE[];*/
|
|
||||||
extern const segT N_TYPE_seg[];
|
extern const segT N_TYPE_seg[];
|
||||||
|
|
||||||
/* Magic number of paged executable. */
|
/* Magic number of paged executable. */
|
||||||
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE 0x8300
|
#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE 0x8300
|
||||||
|
|
||||||
#ifndef BFD_HEADERS
|
|
||||||
|
|
||||||
/* Add these definitions to have a consistent convention for all the
|
|
||||||
types used in COFF format. */
|
|
||||||
#define AOUTHDR struct aouthdr
|
|
||||||
#define AOUTHDRSZ sizeof(AOUTHDR)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* SYMBOL TABLE */
|
/* SYMBOL TABLE */
|
||||||
|
|
||||||
@ -483,31 +462,21 @@ typedef struct {
|
|||||||
unsigned long pointer;
|
unsigned long pointer;
|
||||||
} stack;
|
} stack;
|
||||||
|
|
||||||
#ifdef __STDC__
|
|
||||||
|
|
||||||
char *stack_pop(stack *st);
|
|
||||||
char *stack_push(stack *st, char *element);
|
|
||||||
char *stack_top(stack *st);
|
|
||||||
stack *stack_init(unsigned long chunk_size, unsigned long element_size);
|
|
||||||
void c_dot_file_symbol(char *filename);
|
|
||||||
void obj_extra_stuff(object_headers *headers);
|
|
||||||
void stack_delete(stack *st);
|
|
||||||
|
|
||||||
#ifndef tc_headers_hook
|
char *EXFUN(stack_pop,(stack *st));
|
||||||
void tc_headers_hook(object_headers *headers);
|
char *EXFUN(stack_push,(stack *st, char *element));
|
||||||
#endif /* tc_headers_hook */
|
char *EXFUN(stack_top,(stack *st));
|
||||||
|
stack *EXFUN(stack_init,(unsigned long chunk_size, unsigned long element_size));
|
||||||
|
void EXFUN(c_dot_file_symbol,(char *filename));
|
||||||
|
void EXFUN(obj_extra_stuff,(object_headers *headers));
|
||||||
|
void EXFUN(stack_delete,(stack *st));
|
||||||
|
|
||||||
#ifndef tc_coff_symbol_emit_hook
|
|
||||||
void tc_coff_symbol_emit_hook(); /* really tc_coff_symbol_emit_hook(symbolS *symbolP) */
|
|
||||||
#endif /* tc_coff_symbol_emit_hook */
|
|
||||||
|
|
||||||
void c_section_header(
|
|
||||||
#ifdef BFD_HEADERS
|
void EXFUN(c_section_header,(
|
||||||
|
|
||||||
struct internal_scnhdr *header,
|
struct internal_scnhdr *header,
|
||||||
#else
|
|
||||||
SCNHDR *header,
|
|
||||||
#endif
|
|
||||||
|
|
||||||
char *name,
|
char *name,
|
||||||
long core_address,
|
long core_address,
|
||||||
long size,
|
long size,
|
||||||
@ -516,22 +485,7 @@ void c_section_header(
|
|||||||
long lineno_ptr,
|
long lineno_ptr,
|
||||||
long reloc_number,
|
long reloc_number,
|
||||||
long lineno_number,
|
long lineno_number,
|
||||||
long alignment);
|
long alignment));
|
||||||
|
|
||||||
#else /* __STDC__ */
|
|
||||||
|
|
||||||
char *stack_pop();
|
|
||||||
char *stack_push();
|
|
||||||
char *stack_top();
|
|
||||||
stack *stack_init();
|
|
||||||
void c_dot_file_symbol();
|
|
||||||
void c_section_header();
|
|
||||||
void obj_extra_stuff();
|
|
||||||
void stack_delete();
|
|
||||||
void tc_headers_hook();
|
|
||||||
void tc_coff_symbol_emit_hook();
|
|
||||||
|
|
||||||
#endif /* __STDC__ */
|
|
||||||
|
|
||||||
|
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
|
Reference in New Issue
Block a user