aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobody <>2002-10-22 01:43:38 +0000
committernobody <>2002-10-22 01:43:38 +0000
commit1171e2137801d2fc562e6568bf97a0ad309316f8 (patch)
treee19835d2792fb05dda8551245f184a54ee5062c6
parentf5a2cc46292054e10dafcb7bd58c1a50056702de (diff)
downloadgdb-1171e2137801d2fc562e6568bf97a0ad309316f8.zip
gdb-1171e2137801d2fc562e6568bf97a0ad309316f8.tar.gz
gdb-1171e2137801d2fc562e6568bf97a0ad309316f8.tar.bz2
This commit was manufactured by cvs2svn to create branch
'carlton_dictionary-branch'. Cherrypick from master 2002-10-22 01:43:37 UTC Daniel Jacobowitz <drow@false.org> ' * gdb.asm/asm-source.exp: Add "mips*-*" pattern. Update line': bfd/elf32-qnx.c gdb/config/i386/obsd.mt gdb/testsuite/gdb.asm/mips.inc
-rw-r--r--bfd/elf32-qnx.c92
-rw-r--r--gdb/config/i386/obsd.mt3
-rw-r--r--gdb/testsuite/gdb.asm/mips.inc64
3 files changed, 159 insertions, 0 deletions
diff --git a/bfd/elf32-qnx.c b/bfd/elf32-qnx.c
new file mode 100644
index 0000000..b397c38
--- /dev/null
+++ b/bfd/elf32-qnx.c
@@ -0,0 +1,92 @@
+/* QNX specific support for 32-bit ELF
+ Copyright 2002 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "elf-bfd.h"
+#include "elf32-qnx.h"
+
+/* Returns the end address of the segment + 1. */
+#define SEGMENT_END(segment, start) \
+ (start + (segment->p_memsz > segment->p_filesz \
+ ? segment->p_memsz : segment->p_filesz))
+
+boolean
+elf_qnx_copy_private_bfd_data_p (ibfd, isec, obfd, osec)
+ bfd *ibfd ATTRIBUTE_UNUSED;
+ asection *isec;
+ bfd *obfd ATTRIBUTE_UNUSED;
+ asection *osec ATTRIBUTE_UNUSED;
+{
+ return isec->next == NULL;
+}
+
+boolean
+elf_qnx_is_contained_by_filepos (section, segment)
+ asection *section;
+ Elf_Internal_Phdr *segment;
+{
+ return ((bfd_vma) section->filepos >= segment->p_offset
+ && ((bfd_vma) section->filepos + section->_raw_size
+ <= SEGMENT_END (segment, segment->p_offset)));
+}
+
+void
+elf_qnx_set_nonloadable_filepos (abfd, phdrs)
+ bfd *abfd;
+ Elf_Internal_Phdr *phdrs;
+{
+ struct elf_segment_map *m;
+ Elf_Internal_Phdr *p;
+ file_ptr off = 0;
+
+ for (m = elf_tdata (abfd)->segment_map, p = phdrs;
+ m != NULL;
+ m = m->next, p++)
+ {
+ unsigned int i;
+ asection **secpp;
+
+ for (i = 0, secpp = m->sections; i < m->count; i++, secpp++)
+ {
+ asection *sec;
+
+ sec = *secpp;
+
+ if (p->p_type == PT_LOAD)
+ off = sec->filepos;
+ else
+ {
+ if (i == 0)
+ {
+ if (sec->filepos)
+ p->p_offset = sec->filepos;
+ else
+ p->p_offset = off;
+ }
+ if (!sec->filepos)
+ {
+ off += sec->_raw_size;
+ p->p_filesz += sec->_raw_size;
+ }
+ }
+ }
+ }
+ return;
+}
diff --git a/gdb/config/i386/obsd.mt b/gdb/config/i386/obsd.mt
new file mode 100644
index 0000000..72ec513
--- /dev/null
+++ b/gdb/config/i386/obsd.mt
@@ -0,0 +1,3 @@
+# Target: Intel 386 running OpenBSD
+TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386obsd-tdep.o corelow.o
+TM_FILE= tm-i386.h
diff --git a/gdb/testsuite/gdb.asm/mips.inc b/gdb/testsuite/gdb.asm/mips.inc
new file mode 100644
index 0000000..751f73f
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/mips.inc
@@ -0,0 +1,64 @@
+ comment "subroutine declare"
+ .macro gdbasm_declare name
+ .align 2
+ .ent \name
+ .type \name,@function
+\name:
+ .endm
+
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ .frame $fp, 32, $31
+ .mask 0xd0000000,-4
+ .set noreorder
+ .cpload $25
+ .set reorder
+ subu $sp, $sp, 32
+ .cprestore 16
+ sw $31, 28($sp)
+ sw $fp, 24($sp)
+ sw $28, 20($sp)
+ move $fp, $sp
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ lw $31, 28($sp)
+ lw $fp, 24($sp)
+ .set noreorder
+ .set nomacro
+ j $31
+ addu $sp, $sp, 32
+ .set macro
+ .set reorder
+ .endm
+
+ comment "subroutine end"
+ .macro gdbasm_end name
+ .end \name
+ .endm
+
+ .macro gdbasm_call subr
+ la $25, \subr
+ jal $31, $25
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ comment "Don't know how to exit, but this will certainly halt..."
+ lw $2, 0($0)
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ .global __start
+__start:
+ move $fp, $sp
+ .endm