mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 17:40:49 +00:00
[ bfd/ChangeLog ]
2004-04-21 Chris Demetriou <cgd@broadcom.com> * coff-mips.c (bfd_mips_ecoff_create_embedded_relocs): Remove. * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Remove. * bfd-in.h (bfd_mips_ecoff_create_embedded_relocs) (bfd_mips_elf32_create_embedded_relocs): Remove prototypes * bfd-in2.h: Regenerate. [ ld/ChangeLog ] 2004-04-21 Chris Demetriou <cgd@broadcom.com> * ld.texinfo: Remove MIPS --embedded-relocs documentation. * emulparams/elf32bmip.sh (EXTRA_EM_FILE): Remove definition. * emulparams/mipsidt.sh (TEMPLATE_NAME): Use generic.em. (EXTRA_EM_FILE): Use mipsecoff.em * emulparams/mipsidtl.sh (TEMPLATE_NAME): Use generic.em. (EXTRA_EM_FILE): Use mipsecoff.em * emultempl/mipsecoff.em: Restructure to be included as an extra emulation file. (check_sections, gld${EMULATION_NAME}_after_open) (gld${EMULATION_NAME}_after_allocation) (gld${EMULATION_NAME}_get_script) (ld_${EMULATION_NAME}_emulation): Remove (gld${EMULATION_NAME}_before_parse): Rename to... (mipsecoff_before_parse): This. (LDEMUL_BEFORE_PARSE): Define. * emultempl/mipself.em: Remove file. * scripttempl/mips.sc (.rel.sdata): Do not include in output. (__runtime_reloc_start, __runtime_reloc_stop): Stop providing these symbols. * Makefile.am: Remove dependencies on emultempl/mipself.em. * Makefile.in: Regenerate. [ ld/testsuite/ChangeLog ] 2004-04-21 Chris Demetriou <cgd@broadcom.com> * ld-empic/run.c: Removed as part of MIPS --embedded-relocs removal. * ld-empic/empic.exp: Likewise. * ld-empic/relax.t: Likewise. * ld-empic/relax1.c: Likewise. * ld-empic/relax2.c: Likewise. * ld-empic/relax3.c: Likewise. * ld-empic/relax4.c: Likewise. * ld-empic/runtest1.c: Likewise. * ld-empic/runtest2.c: Likewise. * ld-empic/runtesti.s: Likewise. * ld-mips-elf/empic1-ln.d: Likewise. * ld-mips-elf/empic1-lp.d: Likewise. * ld-mips-elf/empic1-mn.d: Likewise. * ld-mips-elf/empic1-mp.d: Likewise. * ld-mips-elf/empic1-ref.s: Likewise. * ld-mips-elf/empic1-sn.d: Likewise. * ld-mips-elf/empic1-sp.d: Likewise. * ld-mips-elf/empic1-space.s: Likewise. * ld-mips-elf/empic1-tgt.s: Likewise. * ld-mips-elf/empic2-fwd-0.d: Likewise. * ld-mips-elf/empic2-fwd-1.d: Likewise. * ld-mips-elf/empic2-fwd-tgt.s: Likewise. * ld-mips-elf/empic2-ref.s: Likewise. * ld-mips-elf/empic2-rev-0.d: Likewise. * ld-mips-elf/empic2-rev-1.d: Likewise. * ld-mips-elf/empic2-rev-tgt.s: Likewise. * ld-mips-elf/empic2-space.s: Likewise. * ld-mips-elf/emrelocs-eb.d: Likewise. * ld-mips-elf/emrelocs-el.d: Likewise. * ld-mips-elf/emrelocs.ld: Likewise. * ld-mips-elf/emrelocs1.s: Likewise. * ld-mips-elf/emrelocs2.s: Likewise. * ld-mips-elf/mips-elf.exp: Don't run now-removed tests.
This commit is contained in:
126
bfd/coff-mips.c
126
bfd/coff-mips.c
@@ -2323,132 +2323,6 @@ mips_relax_pcrel16 (info, input_bfd, input_section, h, location, address)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Given a .sdata section and a .rel.sdata in-memory section, store
|
||||
relocation information into the .rel.sdata section which can be
|
||||
used at runtime to relocate the section. This is called by the
|
||||
linker when the --embedded-relocs switch is used. This is called
|
||||
after the add_symbols entry point has been called for all the
|
||||
objects, and before the final_link entry point is called. This
|
||||
function presumes that the object was compiled using
|
||||
-membedded-pic. */
|
||||
|
||||
bfd_boolean
|
||||
bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
|
||||
bfd *abfd;
|
||||
struct bfd_link_info *info;
|
||||
asection *datasec;
|
||||
asection *relsec;
|
||||
char **errmsg;
|
||||
{
|
||||
struct ecoff_link_hash_entry **sym_hashes;
|
||||
struct ecoff_section_tdata *section_tdata;
|
||||
struct external_reloc *ext_rel;
|
||||
struct external_reloc *ext_rel_end;
|
||||
bfd_byte *p;
|
||||
bfd_size_type amt;
|
||||
|
||||
BFD_ASSERT (! info->relocatable);
|
||||
|
||||
*errmsg = NULL;
|
||||
|
||||
if (datasec->reloc_count == 0)
|
||||
return TRUE;
|
||||
|
||||
sym_hashes = ecoff_data (abfd)->sym_hashes;
|
||||
|
||||
if (! mips_read_relocs (abfd, datasec))
|
||||
return FALSE;
|
||||
|
||||
amt = (bfd_size_type) datasec->reloc_count * 4;
|
||||
relsec->contents = (bfd_byte *) bfd_alloc (abfd, amt);
|
||||
if (relsec->contents == NULL)
|
||||
return FALSE;
|
||||
|
||||
p = relsec->contents;
|
||||
|
||||
section_tdata = ecoff_section_data (abfd, datasec);
|
||||
ext_rel = (struct external_reloc *) section_tdata->external_relocs;
|
||||
ext_rel_end = ext_rel + datasec->reloc_count;
|
||||
for (; ext_rel < ext_rel_end; ext_rel++, p += 4)
|
||||
{
|
||||
struct internal_reloc int_rel;
|
||||
bfd_boolean text_relative;
|
||||
|
||||
mips_ecoff_swap_reloc_in (abfd, (PTR) ext_rel, &int_rel);
|
||||
|
||||
/* We are going to write a four byte word into the runtime reloc
|
||||
section. The word will be the address in the data section
|
||||
which must be relocated. This must be on a word boundary,
|
||||
which means the lower two bits must be zero. We use the
|
||||
least significant bit to indicate how the value in the data
|
||||
section must be relocated. A 0 means that the value is
|
||||
relative to the text section, while a 1 indicates that the
|
||||
value is relative to the data section. Given that we are
|
||||
assuming the code was compiled using -membedded-pic, there
|
||||
should not be any other possibilities. */
|
||||
|
||||
/* We can only relocate REFWORD relocs at run time. */
|
||||
if (int_rel.r_type != MIPS_R_REFWORD)
|
||||
{
|
||||
*errmsg = _("unsupported reloc type");
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (int_rel.r_extern)
|
||||
{
|
||||
struct ecoff_link_hash_entry *h;
|
||||
|
||||
h = sym_hashes[int_rel.r_symndx];
|
||||
/* If h is NULL, that means that there is a reloc against an
|
||||
external symbol which we thought was just a debugging
|
||||
symbol. This should not happen. */
|
||||
if (h == (struct ecoff_link_hash_entry *) NULL)
|
||||
abort ();
|
||||
if ((h->root.type == bfd_link_hash_defined
|
||||
|| h->root.type == bfd_link_hash_defweak)
|
||||
&& (h->root.u.def.section->flags & SEC_CODE) != 0)
|
||||
text_relative = TRUE;
|
||||
else
|
||||
text_relative = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (int_rel.r_symndx)
|
||||
{
|
||||
case RELOC_SECTION_TEXT:
|
||||
text_relative = TRUE;
|
||||
break;
|
||||
case RELOC_SECTION_SDATA:
|
||||
case RELOC_SECTION_SBSS:
|
||||
case RELOC_SECTION_LIT8:
|
||||
text_relative = FALSE;
|
||||
break;
|
||||
default:
|
||||
/* No other sections should appear in -membedded-pic
|
||||
code. */
|
||||
*errmsg = _("reloc against unsupported section");
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if ((int_rel.r_offset & 3) != 0)
|
||||
{
|
||||
*errmsg = _("reloc not properly aligned");
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bfd_put_32 (abfd,
|
||||
(int_rel.r_vaddr - datasec->vma + datasec->output_offset
|
||||
+ (text_relative ? 0 : 1)),
|
||||
p);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* This is the ECOFF backend structure. The backend field of the
|
||||
target vector points to this. */
|
||||
|
||||
Reference in New Issue
Block a user