aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1992-09-25 18:11:04 +0000
committerSteve Chamberlain <sac@cygnus>1992-09-25 18:11:04 +0000
commit22a78f0d961fdab4eadf6694a636a6b57d3013ad (patch)
tree07a7b2d21ae74990a8f586b78e8fe40db64b86e1 /ld/ldlang.c
parentf4e56031512d5c5621fa2e21e7f3e964718ff39c (diff)
downloadgdb-22a78f0d961fdab4eadf6694a636a6b57d3013ad.zip
gdb-22a78f0d961fdab4eadf6694a636a6b57d3013ad.tar.gz
gdb-22a78f0d961fdab4eadf6694a636a6b57d3013ad.tar.bz2
Fri Sep 25 11:08:01 1992 Steve Chamberlain (sac@thepub.cygnus.com)
Added initial support for the z8k * z8ksim.em, z8ksim.sc-sh, z8ksim.sh: new files * configure.in, Makefile.in: modified to reflect above * ldlang.c (lang_check): when linking conflicting architectures, make the output file reflect at least one of the bad inputs.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c54
1 files changed, 32 insertions, 22 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index cb6ad58..447f2b8 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1846,34 +1846,44 @@ static void
DEFUN_VOID (lang_finish)
{
ldsym_type *lgs;
-
+ int warn = 1;
if (entry_symbol == (char *) NULL)
- {
- /* No entry has been specified, look for start */
- entry_symbol = "start";
- }
+ {
+ /* No entry has been specified, look for start, but don't warn */
+ entry_symbol = "start";
+ warn =0;
+ }
lgs = ldsym_get_soft (entry_symbol);
if (lgs && lgs->sdefs_chain)
- {
- asymbol *sy = *(lgs->sdefs_chain);
+ {
+ asymbol *sy = *(lgs->sdefs_chain);
- /* We can set the entry address*/
- bfd_set_start_address (output_bfd,
- outside_symbol_address (sy));
+ /* We can set the entry address*/
+ bfd_set_start_address (output_bfd,
+ outside_symbol_address (sy));
- }
+ }
else
+ {
+ /* Can't find anything reasonable,
+ use the first address in the text section
+ */
+ asection *ts = bfd_get_section_by_name (output_bfd, ".text");
+ if (ts)
{
- /* Can't find anything reasonable,
- use the first address in the text section
- */
- asection *ts = bfd_get_section_by_name (output_bfd, ".text");
+ if (warn)
+ einfo ("%P: Warning, can't find entry symbol %s, defaulting to %V\n",
+ entry_symbol, ts->vma);
- if (ts)
- {
- bfd_set_start_address (output_bfd, ts->vma);
- }
+ bfd_set_start_address (output_bfd, ts->vma);
}
+ else
+ {
+ if (warn)
+ einfo ("%P: Warning, can't find entry symbol %s, not setting start address\n",
+ entry_symbol);
+ }
+ }
}
/* By now we know the target architecture, and we may have an */
@@ -1905,7 +1915,7 @@ DEFUN_VOID (lang_check)
compatible = bfd_arch_get_compatible (input_bfd,
output_bfd);
-
+
if (compatible)
{
ldfile_output_machine = compatible->mach;
@@ -1919,8 +1929,8 @@ DEFUN_VOID (lang_check)
bfd_printable_name (output_bfd));
bfd_set_arch_mach (output_bfd,
- ldfile_new_output_architecture,
- ldfile_new_output_machine);
+ input_architecture,
+ input_machine);
}
}