mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-18 06:43:36 +08:00
* elf32-mips.c (_bfd_mips_elf32_gprel16_reloc): Reject
R_MIPS_LITERAL relocations for external symbols. * elf64-mips.c (mips_elf64_literal_reloc): Likewise. * elfn32-mips.c (mips_elf_literal_reloc): Likewise.
This commit is contained in:
parent
01b9137461
commit
254f0426b5
@ -1,3 +1,10 @@
|
|||||||
|
2005-02-11 Maciej W. Rozycki <macro@mips.com>
|
||||||
|
|
||||||
|
* elf32-mips.c (_bfd_mips_elf32_gprel16_reloc): Reject
|
||||||
|
R_MIPS_LITERAL relocations for external symbols.
|
||||||
|
* elf64-mips.c (mips_elf64_literal_reloc): Likewise.
|
||||||
|
* elfn32-mips.c (mips_elf_literal_reloc): Likewise.
|
||||||
|
|
||||||
2005-02-11 H.J. Lu <hongjiu.lu@intel.com>
|
2005-02-11 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* bfd-in2.h: Rebuilt.
|
* bfd-in2.h: Rebuilt.
|
||||||
|
@ -770,6 +770,17 @@ _bfd_mips_elf32_gprel16_reloc (bfd *abfd, arelent *reloc_entry,
|
|||||||
bfd_reloc_status_type ret;
|
bfd_reloc_status_type ret;
|
||||||
bfd_vma gp;
|
bfd_vma gp;
|
||||||
|
|
||||||
|
/* R_MIPS_LITERAL relocations are defined for local symbols only. */
|
||||||
|
if (reloc_entry->howto->type == R_MIPS_LITERAL
|
||||||
|
&& output_bfd != NULL
|
||||||
|
&& (symbol->flags & BSF_SECTION_SYM) == 0
|
||||||
|
&& (symbol->flags & BSF_LOCAL) != 0)
|
||||||
|
{
|
||||||
|
*error_message = (char *)
|
||||||
|
_("literal relocation occurs for an external symbol");
|
||||||
|
return bfd_reloc_outofrange;
|
||||||
|
}
|
||||||
|
|
||||||
if (output_bfd != NULL)
|
if (output_bfd != NULL)
|
||||||
relocatable = TRUE;
|
relocatable = TRUE;
|
||||||
else
|
else
|
||||||
|
@ -1543,14 +1543,14 @@ mips_elf64_literal_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
|
|||||||
bfd_reloc_status_type ret;
|
bfd_reloc_status_type ret;
|
||||||
bfd_vma gp;
|
bfd_vma gp;
|
||||||
|
|
||||||
/* If we're relocating, and this is an external symbol, we don't
|
/* R_MIPS_LITERAL relocations are defined for local symbols only. */
|
||||||
want to change anything. */
|
|
||||||
if (output_bfd != NULL
|
if (output_bfd != NULL
|
||||||
&& (symbol->flags & BSF_SECTION_SYM) == 0
|
&& (symbol->flags & BSF_SECTION_SYM) == 0
|
||||||
&& (symbol->flags & BSF_LOCAL) != 0)
|
&& (symbol->flags & BSF_LOCAL) != 0)
|
||||||
{
|
{
|
||||||
reloc_entry->address += input_section->output_offset;
|
*error_message = (char *)
|
||||||
return bfd_reloc_ok;
|
_("literal relocation occurs for an external symbol");
|
||||||
|
return bfd_reloc_outofrange;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */
|
/* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */
|
||||||
|
@ -1348,6 +1348,16 @@ mips_elf_literal_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
|
|||||||
bfd_reloc_status_type ret;
|
bfd_reloc_status_type ret;
|
||||||
bfd_vma gp;
|
bfd_vma gp;
|
||||||
|
|
||||||
|
/* R_MIPS_LITERAL relocations are defined for local symbols only. */
|
||||||
|
if (output_bfd != NULL
|
||||||
|
&& (symbol->flags & BSF_SECTION_SYM) == 0
|
||||||
|
&& (symbol->flags & BSF_LOCAL) != 0)
|
||||||
|
{
|
||||||
|
*error_message = (char *)
|
||||||
|
_("literal relocation occurs for an external symbol");
|
||||||
|
return bfd_reloc_outofrange;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */
|
/* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */
|
||||||
if (output_bfd != NULL)
|
if (output_bfd != NULL)
|
||||||
relocatable = TRUE;
|
relocatable = TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user