aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorMichael Tiemann <tiemann@cygnus>1992-02-02 21:12:25 +0000
committerMichael Tiemann <tiemann@cygnus>1992-02-02 21:12:25 +0000
commit58216160ef6573acb817676795cadab967afea2d (patch)
tree50e599f8c8197d916467aa336ebc4addb06707b0 /ld
parent05cd8d982d8efb768cd39fe25fc66edf758a1f8e (diff)
downloadfsf-binutils-gdb-58216160ef6573acb817676795cadab967afea2d.zip
fsf-binutils-gdb-58216160ef6573acb817676795cadab967afea2d.tar.gz
fsf-binutils-gdb-58216160ef6573acb817676795cadab967afea2d.tar.bz2
Work around for problems in linking C++ programs that need file-level
initialization. Now C++ programs can be linked.
Diffstat (limited to 'ld')
-rw-r--r--ld/ldsym.c3
-rw-r--r--ld/relax.c36
2 files changed, 21 insertions, 18 deletions
diff --git a/ld/ldsym.c b/ld/ldsym.c
index 007d191..3ab8799 100644
--- a/ld/ldsym.c
+++ b/ld/ldsym.c
@@ -360,7 +360,10 @@ LANG_FOR_EACH_INPUT_STATEMENT(entry)
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 */
+ if (p->section == 0)
+ p->section = &bfd_abs_section;
if (flag_is_global(p->flags) )
{
/* We are only interested in outputting
diff --git a/ld/relax.c b/ld/relax.c
index 5500f5e..a0a8ab6 100644
--- a/ld/relax.c
+++ b/ld/relax.c
@@ -28,7 +28,7 @@ DEFUN(build_it,(statement),
{
switch (statement->header.type) {
case lang_fill_statement_enum:
- {
+ {
#if 0
bfd_byte play_area[SHORT_SIZE];
unsigned int i;
@@ -57,13 +57,13 @@ DEFUN(build_it,(statement),
}
#endif
+ abort();
}
break;
case lang_data_statement_enum:
- {
-abort();
-
#if 0
+ {
+
bfd_vma value = statement->data_statement.value;
bfd_byte play_area[LONG_SIZE];
unsigned int size = 0;
@@ -89,29 +89,29 @@ abort();
size);
-#endif
}
+#endif
break;
case lang_input_section_enum:
- {
- /* Create a new seclet in the output section with this
- attached */
+ {
+ /* Create a new seclet in the output section with this
+ attached */
- asection *i = statement->input_section.section;
+ asection *i = statement->input_section.section;
- asection *output_section = i->output_section;
+ asection *output_section = i->output_section;
- bfd_seclet_type *seclet = bfd_new_seclet(output_section->owner,output_section);
+ bfd_seclet_type *seclet = bfd_new_seclet(output_section->owner,output_section);
- seclet->type = bfd_indirect_seclet;
- seclet->u.indirect.section = i;
- seclet->u.indirect.symbols = statement->input_section.ifile->asymbols;
- seclet->size = bfd_get_section_size_before_reloc(i);
- seclet->offset = i->output_offset;
- seclet->next = 0;
+ seclet->type = bfd_indirect_seclet;
+ seclet->u.indirect.section = i;
+ seclet->u.indirect.symbols = statement->input_section.ifile->asymbols;
+ seclet->size = bfd_get_section_size_before_reloc(i);
+ seclet->offset = i->output_offset;
+ seclet->next = 0;
- }
+ }
break;
default: