fix archive scanning, linking and support more amiga mem types

This commit is contained in:
bebbo
2017-12-21 19:15:35 +01:00
parent 72e25c3819
commit 146f10290b
8 changed files with 73 additions and 24 deletions
+11 -1
View File
@@ -89,7 +89,7 @@ char *myname;
segT reg_section, expr_section;
segT text_section, data_section, bss_section;
#ifdef OBJ_AMIGAHUNK
segT data_chip_section, bss_chip_section;
segT data_chip_section, data_fast_section, data_far_section, bss_chip_section, bss_fast_section, bss_far_section;
#endif
#endif
@@ -1049,7 +1049,11 @@ perform_an_assembly_pass (argc, argv)
bss_section = subseg_new (BSS_SECTION_NAME, 0);
#ifdef OBJ_AMIGAHUNK
data_chip_section = subseg_new (".data_chip", 0);
data_fast_section = subseg_new (".data_fast", 0);
data_far_section = subseg_new (".data_far", 0);
bss_chip_section = subseg_new (".bss_chip", 0);
bss_fast_section = subseg_new (".bss_fast", 0);
bss_far_section = subseg_new (".bss_far", 0);
#endif
/* @@ FIXME -- we're setting the RELOC flag so that sections are assumed
to have relocs, otherwise we don't find out in time. */
@@ -1064,7 +1068,13 @@ perform_an_assembly_pass (argc, argv)
#ifdef OBJ_AMIGAHUNK
bfd_set_section_flags (stdoutput, data_chip_section,
applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC));
bfd_set_section_flags (stdoutput, data_fast_section,
applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC));
bfd_set_section_flags (stdoutput, data_far_section,
applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC));
bfd_set_section_flags (stdoutput, bss_chip_section, applicable & SEC_ALLOC);
bfd_set_section_flags (stdoutput, bss_fast_section, applicable & SEC_ALLOC);
bfd_set_section_flags (stdoutput, bss_far_section, applicable & SEC_ALLOC);
#endif
seg_info (bss_section)->bss = 1;
+5 -3
View File
@@ -25,6 +25,7 @@
#include "obstack.h"
#include "subsegs.h"
#include "dwarf2dbg.h"
#include "struc-symbol.h"
#include "opcode/m68k.h"
#include "m68k-parse.h"
@@ -1576,7 +1577,8 @@ m68k_ip (instring)
case 'B': /* FOO */
if (opP->mode != ABSL
|| (flag_long_jumps
&& strncmp (instring, "jbsr", 4) == 0))
&& opP->disp.exp.X_add_symbol->bsym && opP->disp.exp.X_add_symbol->bsym->name[0] != '.'
&& (strncmp (instring, "jbsr", 4) == 0 || strncmp (instring, "jra", 3) == 0)))
losing++;
break;
@@ -7176,8 +7178,8 @@ md_show_usage (stream)
target has/lacks memory-management unit coprocessor\n\
[default yes for 68020 and up]\n\
-pic, -k generate position independent code\n\
-S turn jbsr into jsr\n\
-smallcode, -sc small code model\n\
-S turn jbsr into jsr and keeps jra for non local labels.\n\
-smallcode, -sc small code model - does nothing atm\n\
--pcrel never turn PC-relative branches into absolute jumps\n\
--register-prefix-optional\n\
recognize register names without prefix character\n\
+29 -5
View File
@@ -49,7 +49,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#endif
#ifdef OBJ_AMIGAHUNK
extern segT data_chip_section, bss_chip_section;
extern segT data_chip_section, data_fast_section, data_far_section, bss_chip_section, bss_fast_section, bss_far_section;
#endif
/* Set by the object-format or the target. */
@@ -282,7 +282,12 @@ static const pseudo_typeS potable[] = {
{"common.s", s_mri_common, 1},
{"data", s_data, 0},
#ifdef OBJ_AMIGAHUNK
{"datachip", s_data_chip, 0},
{"datachip", s_data_amiga, 0},
{"datafast", s_data_amiga, 1},
{"datafar", s_data_amiga, 2},
{"bsschip", s_data_amiga, 0+8},
{"bssfast", s_data_amiga, 1+8},
{"bssfar", s_data_amiga, 2+8},
#endif
{"dc", cons, 2},
{"dc.b", cons, 1},
@@ -1565,11 +1570,30 @@ s_data (ignore)
#ifdef OBJ_AMIGAHUNK
void
s_data_chip (ignore)
int ignore ATTRIBUTE_UNUSED;
s_data_amiga (which)
int which;
{
int temp = get_absolute_expression ();
subseg_set (data_chip_section, (subsegT) temp);
switch (which) {
case 0:
subseg_set (data_chip_section, (subsegT) temp);
break;
case 1:
subseg_set (data_fast_section, (subsegT) temp);
break;
case 2:
subseg_set (data_far_section, (subsegT) temp);
break;
case 8:
subseg_set (bss_chip_section, (subsegT) temp);
break;
case 9:
subseg_set (bss_fast_section, (subsegT) temp);
break;
case 10:
subseg_set (bss_far_section, (subsegT) temp);
break;
}
demand_empty_rest_of_line ();
}
#endif
+1 -1
View File
@@ -145,7 +145,7 @@ extern void s_bad_endr PARAMS ((int));
extern void s_comm PARAMS ((int));
extern void s_data PARAMS ((int));
#ifdef OBJ_AMIGAHUNK
extern void s_data_chip PARAMS ((int));
extern void s_data_amiga PARAMS ((int));
#endif
extern void s_desc PARAMS ((int));
extern void s_else PARAMS ((int arg));
+6 -11
View File
@@ -207,11 +207,9 @@ s_stab_generic (what, stab_secname, stabstr_secname)
{
int length;
string = demand_copy_C_string (&length);
/* FIXME: We should probably find some other temporary storage
for string, rather than leaking memory if someone else
happens to use the notes obstack. */
saved_string_obstack_end = notes.next_free;
string = strdup(demand_copy_C_string (&length));
saved_string_obstack_end = string;
SKIP_WHITESPACE ();
if (*input_line_pointer == ',')
input_line_pointer++;
@@ -348,12 +346,6 @@ s_stab_generic (what, stab_secname, stabstr_secname)
}
stroff = get_stab_string_offset (string, stabstr_secname);
if (what == 's')
{
/* Release the string, if nobody else has used the obstack. */
if (saved_string_obstack_end == notes.next_free)
obstack_free (&notes, string);
}
/* At least for now, stabs in a special stab section are always
output as 12 byte blocks of information. */
@@ -401,6 +393,9 @@ s_stab_generic (what, stab_secname, stabstr_secname)
#endif
}
if (saved_string_obstack_end)
free(string);
demand_empty_rest_of_line ();
}
+1 -1
View File
@@ -1,4 +1,4 @@
/* struct_symbol.h - Internal symbol structure
/* struc-symbol.h - Internal symbol structure
Copyright 1987, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.