* ldver.c: Bumped version to 1.96 - new release, resync with the

bfd too #.
	* ldexp.c, ldlang.c: now build memory shape tree in obstacks
	rather than with raw malloc, makes it easier to track where memory
	is going.
	* ldsym.h, ldsym.c: create obstack for all global symbols too.
	* ldwrite.c (ldwrite): moved malloc so only used when needed.
	* sa29200-sc.sh: added support for .lit, data1 and data2 sections.
This commit is contained in:
Steve Chamberlain
1992-05-04 23:38:42 +00:00
parent f7ebd77dba
commit bfbdc80f0a
10 changed files with 288 additions and 154 deletions

View File

@ -1,3 +1,15 @@
Mon May 4 16:10:10 1992 Steve Chamberlain (sac@thepub.cygnus.com)
* ldver.c: Bumped version to 1.96 - new release, resync with the
bfd too #.
* ldexp.c, ldlang.c: now build memory shape tree in obstacks
rather than with raw malloc, makes it easier to track where memory
is going.
* ldsym.h, ldsym.c: create obstack for all global symbols too.
* ldwrite.c (ldwrite): moved malloc so only used when needed.
* sa29200-sc.sh: added support for .lit, data1 and data2 sections.
Fri May 1 18:17:52 1992 K. Richard Pixley (rich@cygnus.com) Fri May 1 18:17:52 1992 K. Richard Pixley (rich@cygnus.com)
* config/sparc.mh: use ../gcc/libgcc.a on check if it exists. * config/sparc.mh: use ../gcc/libgcc.a on check if it exists.

View File

@ -157,7 +157,7 @@ etree_type *
DEFUN(exp_intop,(value), DEFUN(exp_intop,(value),
bfd_vma value) bfd_vma value)
{ {
etree_type *new = (etree_type *)ldmalloc((bfd_size_type)(sizeof(new->value))); etree_type *new = (etree_type *)stat_alloc((bfd_size_type)(sizeof(new->value)));
new->type.node_code = INT; new->type.node_code = INT;
new->value.value = value; new->value.value = value;
new->type.node_class = etree_value; new->type.node_class = etree_value;
@ -520,7 +520,7 @@ DEFUN(exp_fold_tree,(tree, current_section, allocation_done,
} }
else else
{ {
def_ptr = (asymbol **)ldmalloc((bfd_size_type)(sizeof(asymbol **))); def_ptr = (asymbol **)stat_alloc((bfd_size_type)(sizeof(asymbol **)));
def = (asymbol *)bfd_make_empty_symbol(script_file->the_bfd); def = (asymbol *)bfd_make_empty_symbol(script_file->the_bfd);
@ -589,7 +589,7 @@ DEFUN(exp_binop,(code, lhs, rhs),
{ {
return exp_intop(r.value); return exp_intop(r.value);
} }
new = (etree_type *)ldmalloc((bfd_size_type)(sizeof(new->binary))); new = (etree_type *)stat_alloc((bfd_size_type)(sizeof(new->binary)));
memcpy((char *)new, (char *)&value, sizeof(new->binary)); memcpy((char *)new, (char *)&value, sizeof(new->binary));
return new; return new;
} }
@ -613,7 +613,7 @@ DEFUN(exp_trinop,(code, cond, lhs, rhs),
if (r.valid) { if (r.valid) {
return exp_intop(r.value); return exp_intop(r.value);
} }
new = (etree_type *)ldmalloc((bfd_size_type)(sizeof(new->trinary))); new = (etree_type *)stat_alloc((bfd_size_type)(sizeof(new->trinary)));
memcpy((char *)new,(char *) &value, sizeof(new->trinary)); memcpy((char *)new,(char *) &value, sizeof(new->trinary));
return new; return new;
} }
@ -635,7 +635,7 @@ DEFUN(exp_unop,(code, child),
if (r.valid) { if (r.valid) {
return exp_intop(r.value); return exp_intop(r.value);
} }
new = (etree_type *)ldmalloc((bfd_size_type)(sizeof(new->unary))); new = (etree_type *)stat_alloc((bfd_size_type)(sizeof(new->unary)));
memcpy((char *)new, (char *)&value, sizeof(new->unary)); memcpy((char *)new, (char *)&value, sizeof(new->unary));
return new; return new;
} }
@ -648,7 +648,6 @@ DEFUN(exp_nameop,(code, name),
{ {
etree_type value, *new; etree_type value, *new;
etree_value_type r; etree_value_type r;
value.name.type.node_code = code; value.name.type.node_code = code;
value.name.name = name; value.name.name = name;
@ -661,7 +660,7 @@ DEFUN(exp_nameop,(code, name),
if (r.valid) { if (r.valid) {
return exp_intop(r.value); return exp_intop(r.value);
} }
new = (etree_type *)ldmalloc((bfd_size_type)(sizeof(new->name))); new = (etree_type *)stat_alloc((bfd_size_type)(sizeof(new->name)));
memcpy((char *)new, (char *)&value, sizeof(new->name)); memcpy((char *)new, (char *)&value, sizeof(new->name));
return new; return new;
@ -690,7 +689,7 @@ DEFUN(exp_assop,(code, dst, src),
return exp_intop(result); return exp_intop(result);
} }
#endif #endif
new = (etree_type*)ldmalloc((bfd_size_type)(sizeof(new->assign))); new = (etree_type*)stat_alloc((bfd_size_type)(sizeof(new->assign)));
memcpy((char *)new, (char *)&value, sizeof(new->assign)); memcpy((char *)new, (char *)&value, sizeof(new->assign));
return new; return new;
} }
@ -719,9 +718,11 @@ DEFUN(exp_print_tree,(tree),
exp_print_tree(tree->assign.src); exp_print_tree(tree->assign.src);
break; break;
case etree_binary: case etree_binary:
fprintf(config.map_file,"(");
exp_print_tree(tree->binary.lhs); exp_print_tree(tree->binary.lhs);
exp_print_token(tree->type.node_code); exp_print_token(tree->type.node_code);
exp_print_tree(tree->binary.rhs); exp_print_tree(tree->binary.rhs);
fprintf(config.map_file,")");
break; break;
case etree_trinary: case etree_trinary:
exp_print_tree(tree->trinary.cond); exp_print_tree(tree->trinary.cond);
@ -732,9 +733,14 @@ DEFUN(exp_print_tree,(tree),
break; break;
case etree_unary: case etree_unary:
exp_print_token(tree->unary.type.node_code); exp_print_token(tree->unary.type.node_code);
if (tree->unary.child)
{
fprintf(config.map_file,"("); fprintf(config.map_file,"(");
exp_print_tree(tree->unary.child); exp_print_tree(tree->unary.child);
fprintf(config.map_file,")"); fprintf(config.map_file,")");
}
break; break;
case etree_undef: case etree_undef:
fprintf(config.map_file,"????????"); fprintf(config.map_file,"????????");
@ -745,6 +751,7 @@ DEFUN(exp_print_tree,(tree),
} }
else { else {
exp_print_token(tree->type.node_code); exp_print_token(tree->type.node_code);
if (tree->name.name)
fprintf(config.map_file,"(%s)", tree->name.name); fprintf(config.map_file,"(%s)", tree->name.name);
} }
break; break;
@ -768,7 +775,7 @@ DEFUN(exp_get_vma,(tree, def, name, allocation_done),
if (tree != (etree_type *)NULL) { if (tree != (etree_type *)NULL) {
r = exp_fold_tree_no_dot(tree, r = exp_fold_tree_no_dot(tree,
(lang_output_section_statement_type *)NULL, abs_output_section,
allocation_done); allocation_done);
if (r.valid == false && name) { if (r.valid == false && name) {
einfo("%F%S Nonconstant expression for %s\n",name); einfo("%F%S Nonconstant expression for %s\n",name);

View File

@ -42,6 +42,9 @@ PROTO(static void, print_statement,(lang_statement_union_type *,
/* LOCALS */ /* LOCALS */
static struct obstack stat_obstack;
#define obstack_chunk_alloc ldmalloc
#define obstack_chunk_free free
static CONST char *startup_file; static CONST char *startup_file;
static lang_statement_list_type input_file_chain; static lang_statement_list_type input_file_chain;
@ -109,6 +112,13 @@ extern boolean write_map;
void EXFUN(lang_add_data,( int type , union etree_union *exp)); void EXFUN(lang_add_data,( int type , union etree_union *exp));
PTR
DEFUN(stat_alloc,(size),
size_t size)
{
return obstack_alloc(&stat_obstack, size);
}
static void static void
DEFUN(print_size,(value), DEFUN(print_size,(value),
size_t value) size_t value)
@ -212,7 +222,7 @@ DEFUN(new_statement,(type, size, list),
lang_statement_list_type *list) lang_statement_list_type *list)
{ {
lang_statement_union_type *new = (lang_statement_union_type *) lang_statement_union_type *new = (lang_statement_union_type *)
ldmalloc(size); stat_alloc(size);
new->header.type = type; new->header.type = type;
new->header.next = (lang_statement_union_type *)NULL; new->header.next = (lang_statement_union_type *)NULL;
lang_statement_append(list, new, &new->header.next); lang_statement_append(list, new, &new->header.next);
@ -330,8 +340,10 @@ DEFUN(lang_add_input_file,(name, file_type, target),
void void
DEFUN_VOID(lang_init) DEFUN_VOID(lang_init)
{ {
obstack_begin(&stat_obstack, 1000);
stat_ptr= &statement_list; stat_ptr= &statement_list;
lang_list_init(stat_ptr); lang_list_init(stat_ptr);
lang_list_init(&input_file_chain); lang_list_init(&input_file_chain);
@ -340,9 +352,9 @@ DEFUN_VOID(lang_init)
first_file = lang_add_input_file((char *)NULL, first_file = lang_add_input_file((char *)NULL,
lang_input_file_is_marker_enum, lang_input_file_is_marker_enum,
(char *)NULL); (char *)NULL);
abs_output_section = lang_output_section_statement_lookup(BFD_ABS_SECTION_NAME); abs_output_section = lang_output_section_statement_lookup(BFD_ABS_SECTION_NAME);
abs_output_section->bfd_section = &bfd_abs_section; abs_output_section->bfd_section = &bfd_abs_section;
} }
@ -382,7 +394,7 @@ DEFUN(lang_memory_region_lookup,(name),
} }
{ {
lang_memory_region_type *new = lang_memory_region_type *new =
(lang_memory_region_type *)ldmalloc((bfd_size_type)(sizeof(lang_memory_region_type))); (lang_memory_region_type *)stat_alloc((bfd_size_type)(sizeof(lang_memory_region_type)));
new->name = buystring(name); new->name = buystring(name);
new->next = (lang_memory_region_type *)NULL; new->next = (lang_memory_region_type *)NULL;
@ -503,7 +515,7 @@ DEFUN(init_os,(s),
/* asection *section = bfd_get_section_by_name(output_bfd, s->name);*/ /* asection *section = bfd_get_section_by_name(output_bfd, s->name);*/
section_userdata_type *new = section_userdata_type *new =
(section_userdata_type *) (section_userdata_type *)
ldmalloc((bfd_size_type)(sizeof(section_userdata_type))); stat_alloc((bfd_size_type)(sizeof(section_userdata_type)));
s->bfd_section = bfd_get_section_by_name(output_bfd, s->name); s->bfd_section = bfd_get_section_by_name(output_bfd, s->name);
if (s->bfd_section == (asection *)NULL) if (s->bfd_section == (asection *)NULL)
@ -799,7 +811,7 @@ DEFUN(ldlang_add_undef,(name),
{ {
ldlang_undef_chain_list_type *new = ldlang_undef_chain_list_type *new =
(ldlang_undef_chain_list_type (ldlang_undef_chain_list_type
*)ldmalloc((bfd_size_type)(sizeof(ldlang_undef_chain_list_type))); *)stat_alloc((bfd_size_type)(sizeof(ldlang_undef_chain_list_type)));
new->next = ldlang_undef_chain_list_head; new->next = ldlang_undef_chain_list_head;
ldlang_undef_chain_list_head = new; ldlang_undef_chain_list_head = new;
@ -816,7 +828,7 @@ DEFUN_VOID(lang_place_undefineds)
ldlang_undef_chain_list_type *ptr = ldlang_undef_chain_list_head; ldlang_undef_chain_list_type *ptr = ldlang_undef_chain_list_head;
while (ptr != (ldlang_undef_chain_list_type*)NULL) { while (ptr != (ldlang_undef_chain_list_type*)NULL) {
asymbol *def; asymbol *def;
asymbol **def_ptr = (asymbol **)ldmalloc((bfd_size_type)(sizeof(asymbol **))); asymbol **def_ptr = (asymbol **)stat_alloc((bfd_size_type)(sizeof(asymbol **)));
def = (asymbol *)bfd_make_empty_symbol(script_file->the_bfd); def = (asymbol *)bfd_make_empty_symbol(script_file->the_bfd);
*def_ptr= def; *def_ptr= def;
def->name = ptr->name; def->name = ptr->name;
@ -1272,7 +1284,7 @@ DEFUN(insert_pad,(this_ptr, fill, power, output_section_statement, dot),
{ {
lang_statement_union_type *new = lang_statement_union_type *new =
(lang_statement_union_type *) (lang_statement_union_type *)
ldmalloc((bfd_size_type)(sizeof(lang_padding_statement_type))); stat_alloc((bfd_size_type)(sizeof(lang_padding_statement_type)));
/* Link into existing chain */ /* Link into existing chain */
new->header.next = *this_ptr; new->header.next = *this_ptr;
*this_ptr = new; *this_ptr = new;
@ -1525,7 +1537,7 @@ DEFUN(lang_size_sections,(s, output_section_statement, prev, fill,
{ {
lang_statement_union_type *new = lang_statement_union_type *new =
(lang_statement_union_type *) (lang_statement_union_type *)
ldmalloc((bfd_size_type)(sizeof(lang_padding_statement_type))); stat_alloc((bfd_size_type)(sizeof(lang_padding_statement_type)));
/* Link into existing chain */ /* Link into existing chain */
new->header.next = *prev; new->header.next = *prev;
*prev = new; *prev = new;
@ -2102,7 +2114,7 @@ DEFUN(create_symbol,(name, flags, section),
asection *section) asection *section)
{ {
extern lang_input_statement_type *script_file; extern lang_input_statement_type *script_file;
asymbol **def_ptr = (asymbol **)ldmalloc((bfd_size_type)(sizeof(asymbol **))); asymbol **def_ptr = (asymbol **)stat_alloc((bfd_size_type)(sizeof(asymbol **)));
/* Add this definition to script file */ /* Add this definition to script file */
asymbol *def = (asymbol *)bfd_make_empty_symbol(script_file->the_bfd); asymbol *def = (asymbol *)bfd_make_empty_symbol(script_file->the_bfd);
def->name = buystring(name); def->name = buystring(name);

View File

@ -120,6 +120,8 @@ typedef struct {
typedef struct { typedef struct {
lang_statement_header_type header; lang_statement_header_type header;
fill_type fill; fill_type fill;
int size;
asection *output_section;
} lang_fill_statement_type; } lang_fill_statement_type;
typedef struct { typedef struct {
@ -339,3 +341,4 @@ void EXFUN(lang_add_data,(int type, union etree_union *));
void EXFUN(lang_for_each_statement,(void (*func)())); void EXFUN(lang_for_each_statement,(void (*func)()));
PTR EXFUN(stat_alloc,(size_t size));

View File

@ -130,6 +130,7 @@ main (argc, argv)
output_filename = "a.out"; output_filename = "a.out";
bfd_init(); bfd_init();
#ifdef GNU960 #ifdef GNU960
{ {
int i; int i;
@ -158,7 +159,7 @@ main (argc, argv)
command_line.force_common_definition = false; command_line.force_common_definition = false;
init_bfd_error_vector(); init_bfd_error_vector();
ldsym_init();
ldfile_add_arch(""); ldfile_add_arch("");
ldfile_add_library_path("./"); ldfile_add_library_path("./");
config.make_executable = true; config.make_executable = true;
@ -221,14 +222,14 @@ main (argc, argv)
symbols, and possibly multiple definitions */ symbols, and possibly multiple definitions */
if (config.text_read_only) { if (config.text_read_only)
/* Look for a text section and mark the readonly attribute in it */ {
asection *found = bfd_get_section_by_name(output_bfd, ".text"); /* Look for a text section and mark the readonly attribute in it */
if (found == (asection *)NULL) { asection *found = bfd_get_section_by_name(output_bfd, ".text");
einfo("%P%F: text marked read only, but no text section present"); if (found != (asection *)NULL) {
}
found->flags |= SEC_READONLY; found->flags |= SEC_READONLY;
} }
}
if (config.relocateable_output) { if (config.relocateable_output) {
output_bfd->flags &= ~EXEC_P; output_bfd->flags &= ~EXEC_P;

View File

@ -72,6 +72,10 @@ ldsym_type **symbol_tail_ptr = &symbol_head;
extern ld_config_type config; extern ld_config_type config;
struct obstack global_sym_obstack;
#define obstack_chunk_alloc ldmalloc
#define obstack_chunk_free free
/* /*
incremented for each symbol in the ldsym_type table incremented for each symbol in the ldsym_type table
no matter what flavour it is no matter what flavour it is
@ -150,11 +154,11 @@ DEFUN(ldsym_get,(key),
/* Nothing was found; create a new symbol table entry. */ /* Nothing was found; create a new symbol table entry. */
bp = (ldsym_type *) ldmalloc ((bfd_size_type)(sizeof (ldsym_type))); bp = (ldsym_type *) obstack_alloc (&global_sym_obstack, (bfd_size_type)(sizeof (ldsym_type)));
bp->srefs_chain = (asymbol **)NULL; bp->srefs_chain = (asymbol **)NULL;
bp->sdefs_chain = (asymbol **)NULL; bp->sdefs_chain = (asymbol **)NULL;
bp->scoms_chain = (asymbol **)NULL; bp->scoms_chain = (asymbol **)NULL;
bp->name = buystring(key); bp->name = obstack_copy(&global_sym_obstack, key, strlen(key)+1);
bp->flags = 0; bp->flags = 0;
/* Add the entry to the bucket. */ /* Add the entry to the bucket. */
@ -223,38 +227,36 @@ DEFUN(print_file_stuff,(f),
{ {
asection *s; asection *s;
if (true || option_longmap) { if (true || option_longmap) {
for (s = f->the_bfd->sections; for (s = f->the_bfd->sections;
s != (asection *)NULL; s != (asection *)NULL;
s = s->next) { s = s->next) {
print_address(s->output_offset); print_address(s->output_offset);
if (s->reloc_done) if (s->reloc_done)
{ {
fprintf (config.map_file, " %08x 2**%2ud %s\n", fprintf (config.map_file, " %08x 2**%2ud %s\n",
(unsigned)bfd_get_section_size_after_reloc(s), (unsigned)bfd_get_section_size_after_reloc(s),
s->alignment_power, s->name); s->alignment_power, s->name);
} }
else else
{ {
fprintf (config.map_file, " %08x 2**%2ud %s\n", fprintf (config.map_file, " %08x 2**%2ud %s\n",
(unsigned)bfd_get_section_size_before_reloc(s), (unsigned)bfd_get_section_size_before_reloc(s),
s->alignment_power, s->name); s->alignment_power, s->name);
} }
}
} }
else { }
for (s = f->the_bfd->sections; else
s != (asection *)NULL; {
s = s->next) { for (s = f->the_bfd->sections;
fprintf(config.map_file, "%s ", s->name); s != (asection *)NULL;
print_address(s->output_offset); s = s->next) {
fprintf(config.map_file, "(%x)", (unsigned)bfd_get_section_size_after_reloc(s)); fprintf(config.map_file, "%s ", s->name);
} print_address(s->output_offset);
fprintf(config.map_file, "hex \n"); fprintf(config.map_file, "(%x)", (unsigned)bfd_get_section_size_after_reloc(s));
} }
fprintf(config.map_file, "hex \n");
}
} }
fprintf (config.map_file, "\n"); fprintf (config.map_file, "\n");
} }
@ -329,90 +331,90 @@ static asymbol **
write_file_locals(output_buffer) write_file_locals(output_buffer)
asymbol **output_buffer; asymbol **output_buffer;
{ {
LANG_FOR_EACH_INPUT_STATEMENT(entry) LANG_FOR_EACH_INPUT_STATEMENT(entry)
{ {
/* Run trough the symbols and work out what to do with them */ /* Run trough the symbols and work out what to do with them */
unsigned int i; unsigned int i;
/* Add one for the filename symbol if needed */ /* Add one for the filename symbol if needed */
if (create_object_symbols if (create_object_symbols
!= (lang_output_section_statement_type *)NULL) { != (lang_output_section_statement_type *)NULL) {
asection *s; asection *s;
for (s = entry->the_bfd->sections; for (s = entry->the_bfd->sections;
s != (asection *)NULL; s != (asection *)NULL;
s = s->next) { s = s->next) {
if (s->output_section == create_object_symbols->bfd_section) { if (s->output_section == create_object_symbols->bfd_section) {
/* Add symbol to this section */ /* Add symbol to this section */
asymbol * newsym = asymbol * newsym =
(asymbol *)bfd_make_empty_symbol(entry->the_bfd); (asymbol *)bfd_make_empty_symbol(entry->the_bfd);
newsym->name = entry->local_sym_name; newsym->name = entry->local_sym_name;
/* The symbol belongs to the output file's text section */ /* The symbol belongs to the output file's text section */
/* The value is the start of this section in the output file*/ /* The value is the start of this section in the output file*/
newsym->value = 0; newsym->value = 0;
newsym->flags = BSF_LOCAL; newsym->flags = BSF_LOCAL;
newsym->section = s; newsym->section = s;
*output_buffer++ = newsym; *output_buffer++ = newsym;
break; break;
}
} }
} }
for (i = 0; i < entry->symbol_count; i++) }
{ for (i = 0; i < entry->symbol_count; i++)
asymbol *p = entry->asymbols[i]; {
/* FIXME, temporary hack, since not all of ld knows about the new abs section convention */ asymbol *p = entry->asymbols[i];
/* FIXME, temporary hack, since not all of ld knows about the new abs section convention */
if (p->section == 0) if (p->section == 0)
p->section = &bfd_abs_section; p->section = &bfd_abs_section;
if (flag_is_global(p->flags) ) if (flag_is_global(p->flags) )
{ {
/* We are only interested in outputting /* We are only interested in outputting
globals at this stage in special circumstances */ globals at this stage in special circumstances */
if (p->the_bfd == entry->the_bfd if (p->the_bfd == entry->the_bfd
&& flag_is_not_at_end(p->flags)) { && flag_is_not_at_end(p->flags)) {
/* And this is one of them */ /* And this is one of them */
*(output_buffer++) = p; *(output_buffer++) = p;
p->flags |= BSF_KEEP; p->flags |= BSF_KEEP;
} }
} }
else { else {
if (flag_is_ordinary_local(p->flags)) if (flag_is_ordinary_local(p->flags))
{ {
if (discard_locals == DISCARD_ALL) if (discard_locals == DISCARD_ALL)
{ } { }
else if (discard_locals == DISCARD_L && else if (discard_locals == DISCARD_L &&
(p->name[0] == lprefix)) (p->name[0] == lprefix))
{ } { }
else if (p->flags == BSF_WARNING) else if (p->flags == BSF_WARNING)
{ } { }
else else
{ *output_buffer++ = p; } { *output_buffer++ = p; }
} }
else if (flag_is_debugger(p->flags)) else if (flag_is_debugger(p->flags))
{ {
/* Only keep the debugger symbols if no stripping required */ /* Only keep the debugger symbols if no stripping required */
if (strip_symbols == STRIP_NONE) { if (strip_symbols == STRIP_NONE) {
*output_buffer++ = p; *output_buffer++ = p;
}
}
else if (p->section == &bfd_und_section)
{ /* This must be global */
}
else if (p->section == &bfd_com_section) {
/* And so must this */
}
else if (p->flags & BSF_CTOR) {
/* Throw it away */
}
else
{
FAIL();
}
} }
} }
else if (p->section == &bfd_und_section)
{ /* This must be global */
}
else if (p->section == &bfd_com_section) {
/* And so must this */
}
else if (p->flags & BSF_CTOR) {
/* Throw it away */
}
else
{
FAIL();
}
}
} }
}
return output_buffer; return output_buffer;
} }
@ -502,8 +504,15 @@ DEFUN(ldsym_undefined,(sym),
CONST char *sym) CONST char *sym)
{ {
ldsym_type *from_table = ldsym_get_soft(sym); ldsym_type *from_table = ldsym_get_soft(sym);
if (from_table != (ldsym_type *)NULL) { if (from_table != (ldsym_type *)NULL)
{
if (from_table->sdefs_chain != (asymbol **)NULL) return false; if (from_table->sdefs_chain != (asymbol **)NULL) return false;
} }
return true; return true;
} }
void
DEFUN_VOID(ldsym_init)
{
obstack_begin(&global_sym_obstack, 20000);
}

View File

@ -68,3 +68,4 @@ PROTO(boolean, ldsym_undefined, (CONST char *));
for (x = symbol_head; x != (ldsym_type *)NULL; x = x->next) for (x = symbol_head; x != (ldsym_type *)NULL; x = x->next)
void EXFUN(ldsym_init,(void));

View File

@ -27,9 +27,25 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "sysdep.h" #include "sysdep.h"
#include "ldver.h" #include "ldver.h"
#include "ldemul.h"
void void
ldversion() DEFUN(ldversion,(noisy),
int noisy)
{ {
fprintf(stdout,"gld version BFD 0.18\n"); fprintf(stdout,"ld version 1.96 (with BFD %s)\n", BFD_VERSION);
if (noisy)
{
extern ld_emulation_xfer_type *ld_emulations[];
ld_emulation_xfer_type **ptr = ld_emulations;
printf(" Supported emulations:\n");
while (*ptr)
{
printf(" %s \n", (*ptr)->emulation_name);
ptr++;
}
}
} }

View File

@ -6,14 +6,24 @@ SECTIONS {
.text ${RELOCATING+${TEXT_START_ADDR}} : .text ${RELOCATING+${TEXT_START_ADDR}} :
{ {
*(.text); *(.text);
*(.text1);
*(.text2);
${RELOCATING+_etext = .}; ${RELOCATING+_etext = .};
} }
data . : .lit . :
{
*(.lit);
${RELOCATING+_elit = .};
}
.data . :
{ {
*(.data); *(.data);
*(.data1);
*(.data2);
${RELOCATING+_edata = .}; ${RELOCATING+_edata = .};
${CONSTRUCTING+CONSTRUCTORS} ${CONSTRUCTING+CONSTRUCTORS}
} }
.bss . : .bss . :
{ {
*(COMMON) *(COMMON)

View File

@ -1,17 +1,80 @@
load -I. ld__a29k.c suppress 652
load -I. ld__h8300hms.c load -I../bfd -I../../devo/bfd -I../../devo/include -DMINIMIZE=1 -DDEFAULT_VECTOR='hp300bsd_vec' -DSELECT_VECS='&hp300bsd_vec' ../../devo/bfd/targets.c
load -I. ld__lnk960.c load -I. -I../../devo/ld -I../../devo/include ld__a29k.c
load -I. ld__sun3.c load -I. -I../../devo/ld -I../../devo/include ld__h8300hms.c
load -I. ldlex.c load -I. -I../../devo/ld -I../../devo/include ld__lnk960.c
load -I. ld__ebmon29k.c load -I. -I../../devo/ld -I../../devo/include ld__sun3.c
load -I. ld__h8300xray.c load -I. -I../../devo/ld -I../../devo/include ldlex.c
load -I. ld__m88kbcs.c load -I. -I../../devo/ld -I../../devo/include ld__ebmon29k.c
load -I. ld__sun4.c load -I. -I../../devo/ld -I../../devo/include ld__h8300xray.c
load -I. ld__gld960.c load -I. -I../../devo/ld -I../../devo/include ld__m88kbcs.c
load -I. ld__hp300bsd.c load -I. -I../../devo/ld -I../../devo/include ld__sun4.c
load -I. ld__news.c load -I. -I../../devo/ld -I../../devo/include ld__gld960.c
load -I. ld__vanilla.c load -I. -I../../devo/ld -I../../devo/include ld__hp300bsd.c
load -I. ld__go32.c load -I. -I../../devo/ld -I../../devo/include ld__news.c
load -I. ld__i386aout.c load -I. -I../../devo/ld -I../../devo/include ld__vanilla.c
load -I. ld__st2000.c load -I. -I../../devo/ld -I../../devo/include ld__go32.c
load -I. ldgram.c load -I. -I../../devo/ld -I../../devo/include ld__i386aout.c
load -I. -I../../devo/ld -I../../devo/include ld__st2000.c
load -I. -I../../devo/ld -I../../devo/include ld__sa29200.c
load -I. -I../../devo/ld -I../../devo/include ldgram.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/cplus-dem.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/ldexp.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/ldlang.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/ldver.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/ldctor.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/ldfile.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/ldmain.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/ldwarn.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/mri.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/ldemul.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/ldmisc.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/ldwrite.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/relax.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/lderror.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/ldindr.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/ldsym.c
load -I. -I../../devo/ld -I../../devo/include ../../devo/ld/lexsup.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/bfd.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/stab-sym.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/archures.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/bout.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/cache.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/core.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/aout32.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/demo64.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/opncls.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/reloc.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/seclet.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/init.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/section.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/coff-a29k.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/hp300bsd.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/syms.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/archive.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/libbfd.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/cpu-a29k.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/format.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/cpu-i386.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/cpu-m68k.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/cpu-mips.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/cpu-sparc.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/cpu-h8300.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/cpu-i960.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/cpu-m88k.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/cpu-rs6000.c
load -I../bfd -I../../devo/bfd -I../../devo/include ../../devo/bfd/cpu-vax.c
load -I../libiberty -I../../devo/libiberty -I../../devo/include ../../devo/libiberty/obstack.c
load -I../libiberty -I../../devo/libiberty -I../../devo/include ../../devo/libiberty/strtoul.c
load -I../libiberty -I../../devo/libiberty -I../../devo/include ../../devo/libiberty/strerror.c