aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1998-06-02 16:59:37 +0000
committerIan Lance Taylor <ian@airs.com>1998-06-02 16:59:37 +0000
commitd2256aeb70612f76d37fa10a1bfea61433468f1a (patch)
tree28ff91435922b1b095dd383fb89058028b24b04c /ld
parentc68b56efc5bf81806147871963f09f53606a443c (diff)
downloadgdb-d2256aeb70612f76d37fa10a1bfea61433468f1a.zip
gdb-d2256aeb70612f76d37fa10a1bfea61433468f1a.tar.gz
gdb-d2256aeb70612f76d37fa10a1bfea61433468f1a.tar.bz2
* ldlang.c (lang_finish): If the entry symbol is not found, try
parsing it as a number. * ld.texinfo (Options): Document this.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/ldlang.c47
2 files changed, 37 insertions, 16 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 7ba7a61..c0ee4eb 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jun 2 12:55:03 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * ldlang.c (lang_finish): If the entry symbol is not found, try
+ parsing it as a number.
+ * ld.texinfo (Options): Document this.
+
Mon Jun 1 14:01:20 1998 Ian Lance Taylor <ian@cygnus.com>
* ld.texinfo (Input Section Wildcards): Document SORT keyword.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 3721716..4f692b1 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -985,9 +985,9 @@ wild_sort (wild, file, section)
int i;
i = strcmp (file->filename, ls->ifile->filename);
- if (i < 0)
+ if (i > 0)
continue;
- else if (i > 0)
+ else if (i < 0)
break;
}
@@ -999,7 +999,7 @@ wild_sort (wild, file, section)
if (strcmp (section_name,
bfd_get_section_name (ls->ifile->the_bfd,
ls->section))
- > 0)
+ < 0)
break;
}
}
@@ -2791,25 +2791,40 @@ lang_finish ()
}
else
{
- asection *ts;
+ bfd_vma val;
+ char *send;
- /* Can't find the entry symbol. Use the first address in the
- text section. */
- ts = bfd_get_section_by_name (output_bfd, ".text");
- if (ts != (asection *) NULL)
+ /* We couldn't find the entry symbol. Try parsing it as a
+ number. */
+ val = bfd_scan_vma (entry_symbol, &send, 0);
+ if (*send == '\0')
{
- if (warn)
- einfo (_("%P: warning: cannot find entry symbol %s; defaulting to %V\n"),
- entry_symbol, bfd_get_section_vma (output_bfd, ts));
- if (! bfd_set_start_address (output_bfd,
- bfd_get_section_vma (output_bfd, ts)))
+ if (! bfd_set_start_address (output_bfd, val))
einfo (_("%P%F: can't set start address\n"));
}
else
{
- if (warn)
- einfo (_("%P: warning: cannot find entry symbol %s; not setting start address\n"),
- entry_symbol);
+ asection *ts;
+
+ /* Can't find the entry symbol, and it's not a number. Use
+ the first address in the text section. */
+ ts = bfd_get_section_by_name (output_bfd, ".text");
+ if (ts != (asection *) NULL)
+ {
+ if (warn)
+ einfo (_("%P: warning: cannot find entry symbol %s; defaulting to %V\n"),
+ entry_symbol, bfd_get_section_vma (output_bfd, ts));
+ if (! bfd_set_start_address (output_bfd,
+ bfd_get_section_vma (output_bfd,
+ ts)))
+ einfo (_("%P%F: can't set start address\n"));
+ }
+ else
+ {
+ if (warn)
+ einfo (_("%P: warning: cannot find entry symbol %s; not setting start address\n"),
+ entry_symbol);
+ }
}
}
}