From: Steve Chamberlain Date: Thu, 18 Jun 1992 16:42:46 +0000 (+0000) Subject: * h8300hms.em, h8300hms.sc-sh: do the right thing for -r X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=30d1a3904f93edf8aa397958e74508db5ef584e0;p=binutils-gdb.git * h8300hms.em, h8300hms.sc-sh: do the right thing for -r * ldexp.c: lint * ldlang.c(open_output): set the target arch and machine as soon as we can. (lang_size_sections): use new macros for setting vma * ldwrite.c: lint --- diff --git a/ld/ChangeLog b/ld/ChangeLog index cd923e5c19c..6ad0c500174 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +Thu Jun 18 09:38:56 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * h8300hms.em, h8300hms.sc-sh: do the right thing for -r + * ldexp.c: lint + * ldlang.c(open_output): set the target arch and machine as soon + as we can. (lang_size_sections): use new macros for setting vma + * ldwrite.c: lint + Mon Jun 15 08:47:43 1992 Michael Tiemann (tiemann@rtl.cygnus.com) * configure.in (my_target): Accept m680?0 for wrs as vxworks68. diff --git a/ld/h8300hms.em b/ld/h8300hms.em index c14467bed7f..2402dc9f552 100644 --- a/ld/h8300hms.em +++ b/ld/h8300hms.em @@ -53,10 +53,10 @@ static char *h8300hms_script = #include "h8300hms.x" ; static char *h8300hms_script_option_Ur = -#include "h8300hms.xu" +#include "h8300hms.x" ; static char *h8300hms_script_option_r = -#include "h8300hms.xr" +#include "h8300hms.x" ; static char *h8300hms_get_script() diff --git a/ld/h8300hms.sc-sh b/ld/h8300hms.sc-sh index 6eab5c2e99b..ca19afbba9f 100755 --- a/ld/h8300hms.sc-sh +++ b/ld/h8300hms.sc-sh @@ -16,23 +16,23 @@ SECTIONS { *(.text) *(.strings) - ${RELOCATING+_etext = .;} + _etext = .; } ${RELOCATING+ > ram} .data : { *(.data) - ${RELOCATING+_edata = .;} + _edata = .; } ${RELOCATING+ > ram} .bss : { - ${RELOCATING+ _bss_start = .;} + ${RELOCATING+ _bss_start = .}; *(.bss) *(COMMON) ${RELOCATING+ _end = .}; } ${RELOCATING+ >ram} .stack : { - ${RELOCATING+_stack = .;} + _stack = .; *(.stack) } ${RELOCATING+ > topram} } diff --git a/ld/ldlang.c b/ld/ldlang.c index 00250a30dee..e1f3f2f5419 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -714,30 +714,37 @@ static bfd * DEFUN (open_output, (name), CONST char *CONST name) { + extern unsigned long ldfile_output_machine; + extern enum bfd_architecture ldfile_output_architecture; + extern CONST char *output_filename; bfd *output; if (output_target == (char *) NULL) - { - if (current_target != (char *) NULL) - output_target = current_target; - else - output_target = default_target; - } + { + if (current_target != (char *) NULL) + output_target = current_target; + else + output_target = default_target; + } output = bfd_openw (name, output_target); output_filename = name; if (output == (bfd *) NULL) + { + if (bfd_error == invalid_target) { - if (bfd_error == invalid_target) - { - einfo ("%P%F target %s not found\n", output_target); - } - einfo ("%P%F problem opening output file %s, %E", name); + einfo ("%P%F target %s not found\n", output_target); } + einfo ("%P%F problem opening output file %s, %E", name); + } + + /* output->flags |= D_PAGED;*/ -/* output->flags |= D_PAGED;*/ bfd_set_format (output, bfd_object); + bfd_set_arch_mach(output, + ldfile_output_architecture, + ldfile_output_machine); return output; } @@ -1446,7 +1453,7 @@ DEFUN (lang_size_sections, (s, output_section_statement, prev, fill, if (os->bfd_section == &bfd_abs_section) { /* No matter what happens, an abs section starts at zero */ - os->bfd_section->vma = 0; + bfd_set_section_vma (0, os->bfd_section, 0); } else { @@ -1481,7 +1488,7 @@ DEFUN (lang_size_sections, (s, output_section_statement, prev, fill, dot = align_power (dot, os->bfd_section->alignment_power); - os->bfd_section->vma = dot; + bfd_set_section_vma (0, os->bfd_section, dot); }