This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Sign extend VMAs on MIPS ELF64
- From: Daniel Jacobowitz <drow at false dot org>
- To: binutils at sourceware dot org
- Date: Wed, 22 Aug 2007 16:17:20 -0400
- Subject: Sign extend VMAs on MIPS ELF64
We're careful to mark o32 and n32 addresses as sign extendable for
MIPS, but not n64. Normally this doesn't matter as N64 uses 64-bit
addresses anyway. However gcc with -msym32 will use an address
size of 4 for the .debug_info section. Without this patch GDB
does not sign extend addresses from a MIPS64 Linux kernel built with
-msym32, so e.g. a breakpoint will be set just above 2G instead of at
the very top of memory.
Is this OK? No regressions on the GDB testsuite on various ABIs.
--
Daniel Jacobowitz
CodeSourcery
2007-08-22 Daniel Jacobowitz <dan@codesourcery.com>
* elf64-mips.c (elf_backend_sign_extend_vma): Define.
Index: elf64-mips.c
===================================================================
RCS file: /scratch/gcc/repos/src/src/bfd/elf64-mips.c,v
retrieving revision 1.83
diff -u -p -r1.83 elf64-mips.c
--- elf64-mips.c 10 Jul 2007 04:08:11 -0000 1.83
+++ elf64-mips.c 22 Aug 2007 16:47:28 -0000
@@ -3147,6 +3147,8 @@ const struct elf_size_info mips_elf64_si
#define elf_backend_may_use_rela_p 1
#define elf_backend_default_use_rela_p 1
+#define elf_backend_sign_extend_vma TRUE
+
#define elf_backend_write_section _bfd_mips_elf_write_section
/* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit