diff options
author | Nick Clifton <nickc@redhat.com> | 2002-04-25 10:59:24 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2002-04-25 10:59:24 +0000 |
commit | 3c25c5f6e8cec6d81e1576e2680767e30a17518f (patch) | |
tree | d9cee69823d148950242641f909f06c2bf6b10f5 /bfd | |
parent | 95b80706953a70706f105907c5bb8b8ffb4f844f (diff) | |
download | gdb-3c25c5f6e8cec6d81e1576e2680767e30a17518f.zip gdb-3c25c5f6e8cec6d81e1576e2680767e30a17518f.tar.gz gdb-3c25c5f6e8cec6d81e1576e2680767e30a17518f.tar.bz2 |
The patch contains mostly fixes for the disassembler. It also fixes
a crash of the assembler with some malformed source input.
Long segmented addresses are now correctly relocated.
Finally it updates my email address in the MAINTAINERS file.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/coff-z8k.c | 23 |
2 files changed, 25 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bb7e6bb..19a7047 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2002-04-24 Christian Groessler <chris@groessler.org> + + * coff-z8k.c (extra_case): Fix R_IMM32 relocations: The + addresses are 23bit with a special layout, not plain 32bit + values. Prevent relocation of immediate values. + 2002-04-24 Chris G. Demetriou <cgd@broadcom.com> * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): If MDMX or diff --git a/bfd/coff-z8k.c b/bfd/coff-z8k.c index c626cd7..c1d6a88 100644 --- a/bfd/coff-z8k.c +++ b/bfd/coff-z8k.c @@ -185,10 +185,25 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) break; case R_IMM32: - bfd_put_32 (in_abfd, - /* 0x80000000 indicates a long segmented address. */ - bfd_coff_reloc16_get_value (reloc, link_info, input_section) | 0x80000000, - data + *dst_ptr); + /* If no flags are set, assume immediate value. */ + if (! (*reloc->sym_ptr_ptr)->section->flags) + { + bfd_put_32 (in_abfd, + bfd_coff_reloc16_get_value (reloc, link_info, + input_section), + data + *dst_ptr); + } + else + { + bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info, + input_section); + /* Adresses are 23 bit, and the layout of those in a 32-bit + value is as follows: + 1AAAAAAA xxxxxxxx AAAAAAAA AAAAAAAA + (A - address bits, x - ignore). */ + dst = (dst & 0xffff) | ((dst & 0xff0000) << 8) | 0x80000000; + bfd_put_32 (in_abfd, dst, data + *dst_ptr); + } (*dst_ptr) += 4; (*src_ptr) += 4; break; |