diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-08-21 11:34:06 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-08-21 11:34:06 -0300 |
commit | f3ae7dbacf5aeb9df207f5dacd778a2f6eab24fc (patch) | |
tree | 007fb5f9f137a4cb155cbf457fcd3ae320c2e6f4 /bfd/elf32-i386.c | |
parent | 1d72c7445857652f3eb423f2702bc5981580fb63 (diff) | |
parent | b5d3ac25628b1a16409a9816623c34a45377d400 (diff) | |
download | gdb-users/linaro/binutils-2_27-branch.zip gdb-users/linaro/binutils-2_27-branch.tar.gz gdb-users/linaro/binutils-2_27-branch.tar.bz2 |
Merge with binutils-2_27-branch rev b5d3ac20users/linaro/binutils-2_27-branch
Change-Id: Iaa5f379bb904c3eb5b6e041c62c24076d2838063
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r-- | bfd/elf32-i386.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 4179572..d549ffe 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -3993,7 +3993,9 @@ elf_i386_relocate_section (bfd *output_bfd, - gotplt->output_section->vma - gotplt->output_offset); - if ((*(contents + rel->r_offset - 1) & 0xc7) == 0x5) + if (rel->r_offset > 1 + && (*(contents + rel->r_offset - 1) & 0xc7) == 0x5 + && *(contents + rel->r_offset - 2) != 0x8d) { if (bfd_link_pic (info)) goto disallow_got32; @@ -4263,13 +4265,15 @@ r_386_got32: relocation = (htab->elf.sgot->output_section->vma + htab->elf.sgot->output_offset + off); - if ((*(contents + rel->r_offset - 1) & 0xc7) == 0x5) + if (rel->r_offset > 1 + && (*(contents + rel->r_offset - 1) & 0xc7) == 0x5 + && *(contents + rel->r_offset - 2) != 0x8d) { if (bfd_link_pic (info)) { /* For PIC, disallow R_386_GOT32 without a base - register since we don't know what the GOT base - is. */ + register, except for "lea foo@GOT, %reg", since + we don't know what the GOT base is. */ const char *name; disallow_got32: |