From e2e5acfa756c4de80a904e7525264c24f103f514 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Fri, 21 Feb 1997 18:28:36 +0000 Subject: [PATCH] Fix linker relocation overflow errors for the NEC vr4300/ddb toolchain. These changes are related to Ian's gas/libgloss changes of Dec 13/Dec 18. * tc-mips.c (mips_ip): If configured for an embedded ELF system, don't set the section alignment to 2**4. * mips/ddb.ld: Align the location counter before setting _gp, and before setting edata. Remove ALIGN from _gp computation. * mips/idt.ld, mips/pmon.ld: Before setting _gp, use ALIGN(8) instead of ALIGN(16). Remove ALIGN from _gp computation. --- gas/ChangeLog | 5 +++++ gas/config/tc-mips.c | 28 +++++++++++----------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 08c512fa53c..8743f2241c5 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +Fri Feb 21 10:08:25 1997 Jim Wilson + + * tc-mips.c (mips_ip): If configured for an embedded ELF system, + don't set the section alignment to 2**4. + Fri Feb 21 11:55:03 1997 Ian Lance Taylor * app.c (LEX_IS_TWOCHAR_COMMENT_2ND): Don't define. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 322bfe7afa1..1eb151ff64e 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -6227,20 +6227,11 @@ mips_ip (str, ip) insn_error = NULL; - for (s = str; islower (*s) || (*s >= '0' && *s <= '3') || *s == '6' || *s == '.'; ++s) + for (s = str; *s != '\0' && !isspace(*s); ++s) continue; - switch (*s) - { - case '\0': - break; - - case ' ': - *s++ = '\0'; - break; - - default: - as_fatal ("Unknown opcode: `%s'", str); - } + if ( isspace(*s) ) + *s++ = '\0'; + if ((insn = (struct mips_opcode *) hash_find (op_hash, str)) == NULL) { insn_error = "unrecognized opcode"; @@ -6767,8 +6758,9 @@ mips_ip (str, ip) | SEC_LOAD | SEC_READONLY | SEC_DATA)); - frag_align (*args == 'l' ? 2 : 3, 0); - if (OUTPUT_FLAVOR == bfd_target_elf_flavour) + frag_align (*args == 'l' ? 2 : 3, 0, 0); + if (OUTPUT_FLAVOR == bfd_target_elf_flavour + && strcmp (TARGET_OS, "elf") != 0) record_alignment (new_seg, 4); else record_alignment (new_seg, *args == 'l' ? 2 : 3); @@ -8815,7 +8807,7 @@ mips_align (to, fill, label) symbolS *label; { mips_emit_delays (false); - frag_align (to, fill); + frag_align (to, fill, 0); record_alignment (now_seg, to); if (label != NULL) { @@ -9618,7 +9610,9 @@ mips16_extended_frag (fragp, sec, stretch) { fragS *f; - /* Adjust stretch for any alignment frag. */ + /* Adjust stretch for any alignment frag. FIXME: This + doesn't handle the fr_subtype field, which specifies a + maximum number of bytes to skip when doing an alignment. */ for (f = fragp; f != fragp->fr_symbol->sy_frag; f = f->fr_next) { assert (f != NULL); -- 2.30.2