mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-27 20:03:31 +08:00
* elf32-bfin.c (bfinfdpic_relocate_section): Take more care not to
emit invalid relocs or rofixup entries for deleted .eh_frame entries.
This commit is contained in:
@ -5,6 +5,9 @@
|
|||||||
(elf32_bfin_merge_private_bfd_data): Simplify, and ensure object type
|
(elf32_bfin_merge_private_bfd_data): Simplify, and ensure object type
|
||||||
mismatches are detected.
|
mismatches are detected.
|
||||||
|
|
||||||
|
* elf32-bfin.c (bfinfdpic_relocate_section): Take more care not to
|
||||||
|
emit invalid relocs or rofixup entries for deleted .eh_frame entries.
|
||||||
|
|
||||||
2008-02-11 Daniel Jacobowitz <dan@codesourcery.com>
|
2008-02-11 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
* cache.c (cache_bread): Set bfd_error_file_truncated if EOF
|
* cache.c (cache_bread): Set bfd_error_file_truncated if EOF
|
||||||
|
@ -2479,6 +2479,9 @@ bfinfdpic_relocate_section (bfd * output_bfd,
|
|||||||
{
|
{
|
||||||
int dynindx;
|
int dynindx;
|
||||||
bfd_vma addend = rel->r_addend;
|
bfd_vma addend = rel->r_addend;
|
||||||
|
bfd_vma offset;
|
||||||
|
offset = _bfd_elf_section_offset (output_bfd, info,
|
||||||
|
input_section, rel->r_offset);
|
||||||
|
|
||||||
/* If the symbol is dynamic but binds locally, use
|
/* If the symbol is dynamic but binds locally, use
|
||||||
section+offset. */
|
section+offset. */
|
||||||
@ -2535,25 +2538,34 @@ bfinfdpic_relocate_section (bfd * output_bfd,
|
|||||||
}
|
}
|
||||||
if (!h || h->root.type != bfd_link_hash_undefweak)
|
if (!h || h->root.type != bfd_link_hash_undefweak)
|
||||||
{
|
{
|
||||||
_bfinfdpic_add_rofixup (output_bfd,
|
/* Only output a reloc for a not deleted entry. */
|
||||||
bfinfdpic_gotfixup_section
|
if (offset >= (bfd_vma)-2)
|
||||||
(info),
|
_bfinfdpic_add_rofixup (output_bfd,
|
||||||
_bfd_elf_section_offset
|
bfinfdpic_gotfixup_section
|
||||||
(output_bfd, info,
|
(info), -1, picrel);
|
||||||
input_section, rel->r_offset)
|
else
|
||||||
+ input_section
|
_bfinfdpic_add_rofixup (output_bfd,
|
||||||
->output_section->vma
|
bfinfdpic_gotfixup_section
|
||||||
+ input_section->output_offset,
|
(info),
|
||||||
picrel);
|
offset + input_section
|
||||||
|
->output_section->vma
|
||||||
|
+ input_section->output_offset,
|
||||||
|
picrel);
|
||||||
|
|
||||||
if (r_type == R_BFIN_FUNCDESC_VALUE)
|
if (r_type == R_BFIN_FUNCDESC_VALUE)
|
||||||
_bfinfdpic_add_rofixup
|
{
|
||||||
(output_bfd,
|
if (offset >= (bfd_vma)-2)
|
||||||
bfinfdpic_gotfixup_section (info),
|
_bfinfdpic_add_rofixup
|
||||||
_bfd_elf_section_offset
|
(output_bfd,
|
||||||
(output_bfd, info,
|
bfinfdpic_gotfixup_section (info),
|
||||||
input_section, rel->r_offset)
|
-1, picrel);
|
||||||
+ input_section->output_section->vma
|
else
|
||||||
+ input_section->output_offset + 4, picrel);
|
_bfinfdpic_add_rofixup
|
||||||
|
(output_bfd,
|
||||||
|
bfinfdpic_gotfixup_section (info),
|
||||||
|
offset + input_section->output_section->vma
|
||||||
|
+ input_section->output_offset + 4, picrel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2573,15 +2585,19 @@ bfinfdpic_relocate_section (bfd * output_bfd,
|
|||||||
name, input_bfd, input_section, rel->r_offset);
|
name, input_bfd, input_section, rel->r_offset);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
_bfinfdpic_add_dyn_reloc (output_bfd,
|
/* Only output a reloc for a not deleted entry. */
|
||||||
bfinfdpic_gotrel_section (info),
|
if (offset >= (bfd_vma)-2)
|
||||||
_bfd_elf_section_offset
|
_bfinfdpic_add_dyn_reloc (output_bfd,
|
||||||
(output_bfd, info,
|
bfinfdpic_gotrel_section (info),
|
||||||
input_section, rel->r_offset)
|
0, R_unused0, dynindx, addend, picrel);
|
||||||
+ input_section
|
else
|
||||||
->output_section->vma
|
_bfinfdpic_add_dyn_reloc (output_bfd,
|
||||||
+ input_section->output_offset,
|
bfinfdpic_gotrel_section (info),
|
||||||
r_type, dynindx, addend, picrel);
|
offset
|
||||||
|
+ input_section
|
||||||
|
->output_section->vma
|
||||||
|
+ input_section->output_offset,
|
||||||
|
r_type, dynindx, addend, picrel);
|
||||||
}
|
}
|
||||||
else if (osec)
|
else if (osec)
|
||||||
addend += osec->output_section->vma;
|
addend += osec->output_section->vma;
|
||||||
@ -2591,7 +2607,7 @@ bfinfdpic_relocate_section (bfd * output_bfd,
|
|||||||
relocation = addend - rel->r_addend;
|
relocation = addend - rel->r_addend;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r_type == R_BFIN_FUNCDESC_VALUE)
|
if (r_type == R_BFIN_FUNCDESC_VALUE && offset < (bfd_vma)-2)
|
||||||
{
|
{
|
||||||
/* If we've omitted the dynamic relocation, just emit
|
/* If we've omitted the dynamic relocation, just emit
|
||||||
the fixed addresses of the symbol and of the local
|
the fixed addresses of the symbol and of the local
|
||||||
|
Reference in New Issue
Block a user