mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 03:54:41 +08:00
s390: Add r_offset check to the weak undef change
Since we are accessing up to 2 bytes before the relocation target we should better make sure there are actually 2 bytes before it. ChangeLog: * bfd/elf64-s390.c (elf_s390_relocate_section): Make sure rel->r_offset is large enough.
This commit is contained in:
parent
5998b4a287
commit
f1c4160786
@ -2486,7 +2486,8 @@ elf_s390_relocate_section (bfd *output_bfd,
|
||||
&& !h->root.linker_def
|
||||
&& (bfd_link_executable (info)
|
||||
|| ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
|
||||
&& r_type == R_390_PC32DBL)
|
||||
&& r_type == R_390_PC32DBL
|
||||
&& rel->r_offset >= 2)
|
||||
{
|
||||
void *insn_start = contents + rel->r_offset - 2;
|
||||
uint16_t op = bfd_get_16 (input_bfd, insn_start) & 0xff0f;
|
||||
|
Loading…
Reference in New Issue
Block a user