* config/tc-mips.c (md_begin): If configured for an embedded ELF
system, don't set the section alignment to 2**4. (s_change_sec): Likewise. (append_insn): Call record_alignment for the section. (md_section_align): Don't align the section size for an embedded ELF system.
This commit is contained in:
parent
10e31c750e
commit
08e17202ee
|
@ -1,3 +1,12 @@
|
|||
Fri Dec 13 13:00:33 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* config/tc-mips.c (md_begin): If configured for an embedded ELF
|
||||
system, don't set the section alignment to 2**4.
|
||||
(s_change_sec): Likewise.
|
||||
(append_insn): Call record_alignment for the section.
|
||||
(md_section_align): Don't align the section size for an embedded
|
||||
ELF system.
|
||||
|
||||
Thu Dec 12 16:40:47 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* write.c (adjust_reloc_syms): Make sure that symbols are
|
||||
|
|
|
@ -895,6 +895,7 @@ md_begin ()
|
|||
mips_cprmask[3] = 0;
|
||||
|
||||
/* set the default alignment for the text section (2**2) */
|
||||
if (OUTPUT_FLAVOR != bfd_target_elf_flavour)
|
||||
record_alignment (text_section, 2);
|
||||
|
||||
if (USE_GLOBAL_POINTER_OPT)
|
||||
|
@ -902,10 +903,15 @@ md_begin ()
|
|||
|
||||
if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
|
||||
{
|
||||
/* Sections must be aligned to 16 byte boundaries. */
|
||||
/* On a native system, sections must be aligned to 16 byte
|
||||
boundaries. When configured for an embedded ELF target, we
|
||||
don't bother. */
|
||||
if (strcmp (TARGET_OS, "elf") != 0)
|
||||
{
|
||||
(void) bfd_set_section_alignment (stdoutput, text_section, 4);
|
||||
(void) bfd_set_section_alignment (stdoutput, data_section, 4);
|
||||
(void) bfd_set_section_alignment (stdoutput, bss_section, 4);
|
||||
}
|
||||
|
||||
/* Create a .reginfo section for register masks and a .mdebug
|
||||
section for debugging information. */
|
||||
|
@ -1148,6 +1154,17 @@ append_insn (place, ip, address_expr, reloc_type, unmatched_hi)
|
|||
fixS *fixp;
|
||||
int nops = 0;
|
||||
|
||||
/* Make sure the section will be aligned appropriately. Note that
|
||||
we do not insert an alignment directive; it remains the user's
|
||||
responsibility to align instructions if necessary. Here we only
|
||||
ensure that the section will have the right default alignment, so
|
||||
that the right thing will happen if no alignment directive is
|
||||
used. */
|
||||
if (mips16)
|
||||
record_alignment (now_seg, 1);
|
||||
else
|
||||
record_alignment (now_seg, 2);
|
||||
|
||||
prev_pinfo = prev_insn.insn_mo->pinfo;
|
||||
pinfo = ip->insn_mo->pinfo;
|
||||
|
||||
|
@ -1374,7 +1391,12 @@ append_insn (place, ip, address_expr, reloc_type, unmatched_hi)
|
|||
else if (place != NULL)
|
||||
f = place;
|
||||
else if (mips16 && ! ip->use_extend && reloc_type != BFD_RELOC_MIPS16_JMP)
|
||||
{
|
||||
/* Make sure there is enough room to swap this instruction with
|
||||
a following jump instruction. */
|
||||
frag_grow (6);
|
||||
f = frag_more (2);
|
||||
}
|
||||
else
|
||||
f = frag_more (4);
|
||||
fixp = NULL;
|
||||
|
@ -8466,6 +8488,7 @@ s_change_sec (sec)
|
|||
| SEC_READONLY
|
||||
| SEC_RELOC
|
||||
| SEC_DATA));
|
||||
if (strcmp (TARGET_OS, "elf") != 0)
|
||||
bfd_set_section_alignment (stdoutput, seg, 4);
|
||||
}
|
||||
demand_empty_rest_of_line ();
|
||||
|
@ -8487,6 +8510,7 @@ s_change_sec (sec)
|
|||
bfd_set_section_flags (stdoutput, seg,
|
||||
SEC_ALLOC | SEC_LOAD | SEC_RELOC
|
||||
| SEC_DATA);
|
||||
if (strcmp (TARGET_OS, "elf") != 0)
|
||||
bfd_set_section_alignment (stdoutput, seg, 4);
|
||||
}
|
||||
demand_empty_rest_of_line ();
|
||||
|
@ -8943,7 +8967,10 @@ md_section_align (seg, addr)
|
|||
#ifdef OBJ_ELF
|
||||
/* We don't need to align ELF sections to the full alignment.
|
||||
However, Irix 5 may prefer that we align them at least to a 16
|
||||
byte boundary. */
|
||||
byte boundary. We don't bother to align the sections if we are
|
||||
targeted for an embedded system. */
|
||||
if (strcmp (TARGET_OS, "elf") == 0)
|
||||
return addr;
|
||||
if (align > 4)
|
||||
align = 4;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue