* config/tc-mips.c: If OBJ_ELF, include elf/mips.h.

(mips_regmask_frag): New static variable, if OBJ_ELF.
	(md_begin): If OBJ_ELF, create .reginfo section and set
	mips_regmask_frag to a frag.
	(mips_elf_final_processing): New function, if OBJ_ELF.  Set
	mips_regmask_frag to register mask information.
	* config/tc-mips.h (elf_tc_final_processing): New macro, defined
	if OBJ_ELF.
This commit is contained in:
Ian Lance Taylor 1993-10-12 21:31:29 +00:00
parent 4161c620de
commit f2a663d3a3
2 changed files with 62 additions and 0 deletions

View File

@ -1,3 +1,14 @@
Tue Oct 12 17:26:15 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* config/tc-mips.c: If OBJ_ELF, include elf/mips.h.
(mips_regmask_frag): New static variable, if OBJ_ELF.
(md_begin): If OBJ_ELF, create .reginfo section and set
mips_regmask_frag to a frag.
(mips_elf_final_processing): New function, if OBJ_ELF. Set
mips_regmask_frag to register mask information.
* config/tc-mips.h (elf_tc_final_processing): New macro, defined
if OBJ_ELF.
Tue Oct 12 03:33:26 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
* messages.c (as_fatal): Use myname when printing messages.

View File

@ -42,6 +42,12 @@
#include "opcode/mips.h"
#ifdef OBJ_ELF
#include "elf/mips.h"
static char *mips_regmask_frag;
#endif
#define AT 1
#define GP 28
#define RA 31
@ -389,6 +395,28 @@ md_begin ()
bfd_set_gp_size (stdoutput, g_switch_value);
#endif
#ifdef OBJ_ELF
/* Create a .reginfo section for register masks. */
{
segT seg;
subsegT subseg;
segT regsec;
seg = now_seg;
subseg = now_subseg;
regsec = subseg_new (".reginfo", (subsegT) 0);
/* I don't know why this section should be loaded, but the ABI
says that SHF_ALLOC should be set. */
bfd_set_section_flags (stdoutput, regsec,
SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA);
mips_regmask_frag = frag_more (sizeof (Elf32_External_RegInfo));
subseg_set (seg, subseg);
}
#endif /* OBJ_ELF */
#ifndef OBJ_ECOFF
md_obj_begin ();
#endif
@ -4441,6 +4469,29 @@ mips_define_label (sym)
insn_label = sym;
}
#ifdef OBJ_ELF
/* Write out the .reginfo section for a MIPS ELF file. */
void
mips_elf_final_processing ()
{
Elf32_RegInfo s;
s.ri_gprmask = mips_gprmask;
s.ri_cprmask[0] = mips_cprmask[0];
s.ri_cprmask[1] = mips_cprmask[1];
s.ri_cprmask[2] = mips_cprmask[2];
s.ri_cprmask[3] = mips_cprmask[3];
/* The gp_value field is set by the MIPS ELF backend. */
bfd_mips_elf32_swap_reginfo_out (stdoutput, &s,
((Elf32_External_RegInfo *)
mips_regmask_frag));
}
#endif /* OBJ_ELF */
#ifndef OBJ_ECOFF
/* These functions should really be defined by the object file format,