diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2002-10-08 16:11:07 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2002-10-08 16:11:07 +0000 |
commit | 299bf75951d7a50e5c0dc9f9a33813d5e5589f8b (patch) | |
tree | a4ce8989914bc34934b7f0c4b9b434ce37ac8d4c /bfd | |
parent | 51020317eecbada9ce6f0991f85e852c552add37 (diff) | |
download | gdb-299bf75951d7a50e5c0dc9f9a33813d5e5589f8b.zip gdb-299bf75951d7a50e5c0dc9f9a33813d5e5589f8b.tar.gz gdb-299bf75951d7a50e5c0dc9f9a33813d5e5589f8b.tar.bz2 |
2002-10-08 H.J. Lu <hjl@gnu.org>
* elf32-i386.c (elf_i386_relocate_section): Re-arrange the
IE->LE transition for R_386_TLS_IE.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-i386.c | 50 |
2 files changed, 32 insertions, 23 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5746f81..7cb5ece 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-10-08 H.J. Lu <hjl@gnu.org> + + * elf32-i386.c (elf_i386_relocate_section): Re-arrange the + IE->LE transition for R_386_TLS_IE. + 2002-10-08 Alan Modra <amodra@bigpond.net.au> * elf64-ppc.c (edit_opd): Correct test for discarded sections. diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 87e1e76..483b8a5 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -2617,36 +2617,40 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT (rel->r_offset >= 1); val = bfd_get_8 (input_bfd, contents + rel->r_offset - 1); BFD_ASSERT (rel->r_offset + 4 <= input_section->_raw_size); - if (val != 0xa1) - { - BFD_ASSERT (rel->r_offset >= 2); - type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2); - } if (val == 0xa1) { /* movl foo, %eax. */ bfd_put_8 (output_bfd, 0xb8, contents + rel->r_offset - 1); } - else if (type == 0x8b) - { - /* movl */ - BFD_ASSERT ((val & 0xc7) == 0x05); - bfd_put_8 (output_bfd, 0xc7, - contents + rel->r_offset - 2); - bfd_put_8 (output_bfd, 0xc0 | ((val >> 3) & 7), - contents + rel->r_offset - 1); - } - else if (type == 0x03) + else { - /* addl */ - BFD_ASSERT ((val & 0xc7) == 0x05); - bfd_put_8 (output_bfd, 0x81, - contents + rel->r_offset - 2); - bfd_put_8 (output_bfd, 0xc0 | ((val >> 3) & 7), - contents + rel->r_offset - 1); + BFD_ASSERT (rel->r_offset >= 2); + type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2); + switch (type) + { + case 0x8b: + /* movl */ + BFD_ASSERT ((val & 0xc7) == 0x05); + bfd_put_8 (output_bfd, 0xc7, + contents + rel->r_offset - 2); + bfd_put_8 (output_bfd, + 0xc0 | ((val >> 3) & 7), + contents + rel->r_offset - 1); + break; + case 0x03: + /* addl */ + BFD_ASSERT ((val & 0xc7) == 0x05); + bfd_put_8 (output_bfd, 0x81, + contents + rel->r_offset - 2); + bfd_put_8 (output_bfd, + 0xc0 | ((val >> 3) & 7), + contents + rel->r_offset - 1); + break; + default: + BFD_FAIL (); + break; + } } - else - BFD_FAIL (); bfd_put_32 (output_bfd, -tpoff (info, relocation), contents + rel->r_offset); continue; |