import 7.3.1
This commit is contained in:
parent
473931cbb4
commit
98b9484c67
|
@ -0,0 +1,25 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Linux dumps "struct task_struct" at the end of the core-file. This
|
||||
structure is currently 1080 bytes long, but we allow up to 4096
|
||||
bytes to allow for some future growth. */
|
||||
#define TRAD_CORE_EXTRA_SIZE_ALLOWED 4096
|
||||
#define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(abfd) \
|
||||
((abfd)->tdata.trad_core_data->u.signal)
|
|
@ -0,0 +1,81 @@
|
|||
/* alphavms.h -- BFD definitions for an openVMS host
|
||||
Copyright 1996, 2000, 2001, 2005, 2007, 2008, 2009
|
||||
Free Software Foundation, Inc.
|
||||
Written by Klaus Kämpf (kkaempf@progis.de)
|
||||
of proGIS Softwareentwicklung, Aachen, Germany
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#include <stddef.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <sys/file.h>
|
||||
#include <stdlib.h>
|
||||
#include <unixlib.h>
|
||||
#include <unixio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "bfd.h"
|
||||
#include "filenames.h"
|
||||
|
||||
#ifndef BFD_HOST_64_BIT
|
||||
/* Make the basic types 64-bit quantities on the host.
|
||||
Also provide the support macros BFD needs. */
|
||||
# ifdef __GNUC__
|
||||
# define BFD_HOST_64_BIT long long
|
||||
# else
|
||||
# define BFD_HOST_64_BIT long
|
||||
# endif
|
||||
typedef unsigned BFD_HOST_64_BIT uint64_type;
|
||||
typedef BFD_HOST_64_BIT int64_type;
|
||||
|
||||
# define sprintf_vma(s,x) sprintf (s, "%016lx", x) /* BFD_HOST_64_BIT */
|
||||
# define fprintf_vma(f,x) fprintf (f, "%016lx", x) /* BFD_HOST_64_BIT */
|
||||
|
||||
# define BYTES_IN_PRINTF_INT 4
|
||||
|
||||
/* These must have type unsigned long because they are used as
|
||||
arguments in printf functions. */
|
||||
# define uint64_typeLOW(x) ((unsigned long) (((x) & 0xffffffff))) /* BFD_HOST_64_BIT */
|
||||
# define uint64_typeHIGH(x) ((unsigned long) (((x) >> 32) & 0xffffffff)) /* BFD_HOST_64_BIT */
|
||||
|
||||
#endif /* BFD_HOST_64_BIT */
|
||||
|
||||
#include "fopen-vms.h"
|
||||
|
||||
#define NO_FCNTL 1
|
||||
|
||||
#ifndef O_ACCMODE
|
||||
#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
|
||||
#endif
|
||||
|
||||
extern int getpagesize (void);
|
||||
extern char *stpcpy (char *, const char *);
|
||||
|
||||
/* No intl. */
|
||||
#define gettext(Msgid) (Msgid)
|
||||
#define dgettext(Domainname, Msgid) (Msgid)
|
||||
#define dcgettext(Domainname, Msgid, Category) (Msgid)
|
||||
#define textdomain(Domainname) while (0) /* nothing */
|
||||
#define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
|
||||
#define _(String) (String)
|
||||
#define N_(String) (String)
|
|
@ -0,0 +1,36 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Hopefully this should include either machine/param.h (Ultrix) or
|
||||
machine/machparam.h (Mach), whichever is its name on this system. */
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <machine/vmparam.h>
|
||||
|
||||
#define HOST_PAGE_SIZE NBPG
|
||||
/* #define HOST_SEGMENT_SIZE NBPG -- we use HOST_DATA_START_ADDR */
|
||||
#define HOST_MACHINE_ARCH bfd_arch_mips
|
||||
/* #define HOST_MACHINE_MACHINE */
|
||||
|
||||
#define HOST_TEXT_START_ADDR USRTEXT
|
||||
#define HOST_DATA_START_ADDR USRDATA
|
||||
#define HOST_STACK_END_ADDR USRSTACK
|
||||
|
||||
#define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(core_bfd) \
|
||||
((core_bfd)->tdata.trad_core_data->u.u_arg[0])
|
|
@ -0,0 +1,33 @@
|
|||
/* Copyright 2005, 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Definitions for a Motorola Delta 3300 box running System V R3.0.
|
||||
Contributed by manfred@lts.sel.alcatel.de. */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
/* Definitions used by trad-core.c. */
|
||||
#define NBPG NBPC
|
||||
#define HOST_DATA_START_ADDR u.u_exdata.ux_datorg
|
||||
#define HOST_TEXT_START_ADDR u.u_exdata.ux_txtorg
|
||||
/* User's stack, copied from sys/param.h */
|
||||
#define HOST_STACK_END_ADDR USRSTACK
|
||||
#define UPAGES USIZE
|
||||
#define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(abfd) \
|
||||
abfd->tdata.trad_core_data->u.u_abort
|
|
@ -0,0 +1,27 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Definitions that are needed for core files. Core section sizes for
|
||||
the DPX2 are in bytes. */
|
||||
|
||||
#include <sys/param.h>
|
||||
#define NBPG 1
|
||||
#define UPAGES (USIZE * NBPP)
|
||||
#define HOST_DATA_START_ADDR (u.u_exdata.ux_datorg)
|
||||
#define HOST_STACK_END_ADDR (USERSTACK)
|
|
@ -0,0 +1,32 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#include <sys/param.h>
|
||||
#ifdef BSD4_4
|
||||
#define NO_CORE_COMMAND
|
||||
#endif
|
||||
|
||||
#define HOST_PAGE_SIZE NBPG
|
||||
#define HOST_SEGMENT_SIZE NBPG /* Data seg start addr rounds to NBPG */
|
||||
#define HOST_MACHINE_ARCH bfd_arch_m68k
|
||||
/* #define HOST_MACHINE_MACHINE */
|
||||
|
||||
#define HOST_TEXT_START_ADDR 0
|
||||
#define HOST_STACK_END_ADDR 0xfff00000
|
||||
#define HOST_BIG_ENDIAN_P
|
|
@ -0,0 +1,51 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Intel 386 running any BSD Unix. */
|
||||
|
||||
#include <machine/param.h>
|
||||
#include <machine/vmparam.h>
|
||||
|
||||
/* Recent versions of FreeBSD don't define NBPG. */
|
||||
#ifndef NBPG
|
||||
#ifdef PAGE_SIZE
|
||||
#define NBPG PAGE_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define HOST_PAGE_SIZE NBPG
|
||||
#define HOST_MACHINE_ARCH bfd_arch_i386
|
||||
#define HOST_TEXT_START_ADDR USRTEXT
|
||||
|
||||
/* Jolitz suggested defining HOST_STACK_END_ADDR to
|
||||
(u.u_kproc.kp_eproc.e_vm.vm_maxsaddr + MAXSSIZ), which should work on
|
||||
both BSDI and 386BSD, but that is believed not to work for BSD 4.4. */
|
||||
|
||||
#ifdef __bsdi__
|
||||
/* This seems to be the right thing for BSDI. */
|
||||
#define HOST_STACK_END_ADDR USRSTACK
|
||||
#define HOST_DATA_START_ADDR ((bfd_vma)u.u_kproc.kp_eproc.e_vm.vm_daddr)
|
||||
#else
|
||||
/* This seems to be the right thing for 386BSD release 0.1. */
|
||||
#define HOST_STACK_END_ADDR (USRSTACK - MAXSSIZ)
|
||||
#endif
|
||||
|
||||
#define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(core_bfd) \
|
||||
((core_bfd)->tdata.trad_core_data->u.u_sig)
|
||||
#define u_comm u_kproc.kp_proc.p_comm
|
|
@ -0,0 +1,27 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Linux writes the task structure at the end of the core file. Currently it
|
||||
is 2912 bytes. It is possible that this should be a pickier check, but
|
||||
we should probably not be too picky (the size of the task structure might
|
||||
vary, and if it's not the length we expect it to be, it doesn't affect
|
||||
our ability to process the core file). So allow 0-4096 extra bytes at
|
||||
the end. */
|
||||
|
||||
#define TRAD_CORE_EXTRA_SIZE_ALLOWED 4096
|
|
@ -0,0 +1,44 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#include <machine/vmparam.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
/* This is an ugly way to hack around the incorrect
|
||||
* definition of UPAGES in i386/machparam.h.
|
||||
*
|
||||
* The definition should specify the size reserved
|
||||
* for "struct user" in core files in PAGES,
|
||||
* but instead it gives it in 512-byte core-clicks
|
||||
* for i386 and i860. UPAGES is used only in trad-core.c.
|
||||
*/
|
||||
#if UPAGES == 16
|
||||
#undef UPAGES
|
||||
#define UPAGES 2
|
||||
#endif
|
||||
|
||||
#if UPAGES != 2
|
||||
FIXME!! UPAGES is neither 2 nor 16
|
||||
#endif
|
||||
|
||||
#define HOST_PAGE_SIZE 1
|
||||
#define HOST_SEGMENT_SIZE NBPG
|
||||
#define HOST_MACHINE_ARCH bfd_arch_i386
|
||||
#define HOST_TEXT_START_ADDR USRTEXT
|
||||
#define HOST_STACK_END_ADDR USRSTACK
|
|
@ -0,0 +1,38 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Core file stuff. At least some, perhaps all, of the following
|
||||
defines work on many more systems than just SCO. */
|
||||
|
||||
#define NBPG NBPC
|
||||
#define UPAGES USIZE
|
||||
#define HOST_DATA_START_ADDR u.u_exdata.ux_datorg
|
||||
#define HOST_STACK_START_ADDR u.u_sub
|
||||
#define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(abfd) \
|
||||
((core_upage(abfd)->u_sysabort != 0) \
|
||||
? core_upage(abfd)->u_sysabort \
|
||||
: -1)
|
||||
|
||||
/* According to the manpage, a version 2 SCO corefile can contain
|
||||
various additional sections (it is cleverly arranged so the u area,
|
||||
data, and stack are first where we can find them). So without
|
||||
writing lots of code to parse all their headers and stuff, we can't
|
||||
know whether a corefile is bigger than it should be. */
|
||||
|
||||
#define TRAD_CORE_ALLOW_ANY_EXTRA_SIZE 1
|
|
@ -0,0 +1,46 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* This file was hacked from i386mach3.h [dolan@ssd.intel.com] */
|
||||
|
||||
#include <machine/vmparam.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
/* This is an ugly way to hack around the incorrect
|
||||
* definition of UPAGES in i386/machparam.h.
|
||||
*
|
||||
* The definition should specify the size reserved
|
||||
* for "struct user" in core files in PAGES,
|
||||
* but instead it gives it in 512-byte core-clicks
|
||||
* for i386 and i860. UPAGES is used only in trad-core.c.
|
||||
*/
|
||||
#if UPAGES == 16
|
||||
#undef UPAGES
|
||||
#define UPAGES 2
|
||||
#endif
|
||||
|
||||
#if UPAGES != 2
|
||||
FIXME!! UPAGES is neither 2 nor 16
|
||||
#endif
|
||||
|
||||
#define HOST_PAGE_SIZE 1
|
||||
#define HOST_SEGMENT_SIZE NBPG
|
||||
#define HOST_MACHINE_ARCH bfd_arch_i860
|
||||
#define HOST_TEXT_START_ADDR USRTEXT
|
||||
#define HOST_STACK_END_ADDR USRSTACK
|
|
@ -0,0 +1,35 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Definitions for an Apple Macintosh running A/UX 3.x. */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/page.h>
|
||||
|
||||
/* Definitions used by trad-core.c. */
|
||||
#define NBPG NBPP
|
||||
|
||||
#define HOST_DATA_START_ADDR u.u_exdata.ux_datorg
|
||||
#define HOST_TEXT_START_ADDR u.u_exdata.ux_txtorg
|
||||
#define HOST_STACK_END_ADDR 0x100000000
|
||||
|
||||
#define UPAGES USIZE
|
||||
|
||||
#define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(abfd) \
|
||||
(abfd->tdata.trad_core_data->u.u_arg[0])
|
|
@ -0,0 +1,25 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Linux dumps "struct task_struct" at the end of the core-file. This
|
||||
structure is currently 2512 bytes long, but we allow up to 4096
|
||||
bytes to allow for some future growth. */
|
||||
#define TRAD_CORE_EXTRA_SIZE_ALLOWED 4096
|
||||
#define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(abfd) \
|
||||
((abfd)->tdata.trad_core_data->u.signal)
|
|
@ -0,0 +1,30 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#include <machine/vmparam.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#undef UPAGES
|
||||
#define UPAGES 3
|
||||
|
||||
#define HOST_PAGE_SIZE NBPG
|
||||
#define HOST_SEGMENT_SIZE NBPG
|
||||
#define HOST_MACHINE_ARCH bfd_arch_m88k
|
||||
#define HOST_TEXT_START_ADDR USRTEXT
|
||||
#define HOST_STACK_END_ADDR USRSTACK
|
|
@ -0,0 +1,31 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#include <machine/param.h>
|
||||
#include <machine/vmparam.h>
|
||||
#undef ALIGN
|
||||
|
||||
#define HOST_PAGE_SIZE NBPG
|
||||
/* #define HOST_SEGMENT_SIZE NBPG -- we use HOST_DATA_START_ADDR */
|
||||
#define HOST_MACHINE_ARCH bfd_arch_mips
|
||||
/* #define HOST_MACHINE_MACHINE */
|
||||
|
||||
#define HOST_TEXT_START_ADDR USRTEXT
|
||||
#define HOST_STACK_END_ADDR USRSTACK
|
||||
#define NO_CORE_COMMAND
|
|
@ -0,0 +1,29 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#include <machine/vmparam.h>
|
||||
#include <machine/machparam.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#define HOST_PAGE_SIZE NBPG
|
||||
/* #define HOST_SEGMENT_SIZE NBPG */
|
||||
#define HOST_MACHINE_ARCH bfd_arch_mips
|
||||
#define HOST_TEXT_START_ADDR USRTEXT
|
||||
#define HOST_DATA_START_ADDR USRDATA
|
||||
#define HOST_STACK_END_ADDR USRSTACK
|
|
@ -0,0 +1,31 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Sony News running NewsOS 3.2. */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <machine/vmparam.h>
|
||||
|
||||
#define HOST_PAGE_SIZE NBPG
|
||||
|
||||
#define HOST_MACHINE_ARCH bfd_arch_mips
|
||||
|
||||
#define HOST_TEXT_START_ADDR USRTEXT
|
||||
#define HOST_DATA_START_ADDR USRDATA
|
||||
#define HOST_STACK_END_ADDR USRSTACK
|
|
@ -0,0 +1,28 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Sony News running NewsOS 3.2. */
|
||||
|
||||
#include <machine/vmparam.h>
|
||||
|
||||
#define HOST_PAGE_SIZE NBPG
|
||||
#define HOST_SEGMENT_SIZE NBPG
|
||||
#define HOST_MACHINE_ARCH bfd_arch_m68k
|
||||
#define HOST_TEXT_START_ADDR 0
|
||||
#define HOST_STACK_END_ADDR (KERNBASE - (UPAGES * NBPG))
|
|
@ -0,0 +1,43 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#include <machine/vmparam.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
/* This is an ugly way to hack around the incorrect
|
||||
* definition of UPAGES in ns532/machparam.h.
|
||||
*
|
||||
* The definition should specify the size reserved
|
||||
* for "struct user" in core files in PAGES,
|
||||
* but instead it gives it in 512-byte core-clicks
|
||||
* for ns532, i386 and i860. UPAGES is used only in trad-core.c.
|
||||
*/
|
||||
#if UPAGES == 16
|
||||
#undef UPAGES
|
||||
#define UPAGES 2
|
||||
#endif
|
||||
|
||||
#if UPAGES != 2
|
||||
#error UPAGES is neither 2 nor 16
|
||||
#endif
|
||||
|
||||
#define HOST_PAGE_SIZE 1
|
||||
#define HOST_SEGMENT_SIZE NBPG
|
||||
#define HOST_TEXT_START_ADDR USRTEXT
|
||||
#define HOST_STACK_END_ADDR USRSTACK
|
|
@ -0,0 +1,29 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* RISC/os 4.52C, and presumably other versions. */
|
||||
|
||||
#include <bsd43/machine/machparam.h>
|
||||
#include <bsd43/machine/vmparam.h>
|
||||
|
||||
#define NBPG BSD43_NBPG
|
||||
#define UPAGES BSD43_UPAGES
|
||||
#define HOST_TEXT_START_ADDR BSD43_USRTEXT
|
||||
#define HOST_DATA_START_ADDR BSD43_USRDATA
|
||||
#define HOST_STACK_END_ADDR BSD43_USRSTACK
|
|
@ -0,0 +1,39 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Symmetry running either dynix 3.1 (bsd) or ptx (sysv). */
|
||||
|
||||
#define NBPG 4096
|
||||
#define UPAGES 1
|
||||
|
||||
#ifdef _SEQUENT_
|
||||
/* ptx */
|
||||
#define HOST_TEXT_START_ADDR 0
|
||||
#define HOST_STACK_END_ADDR 0x3fffe000
|
||||
#define TRAD_CORE_USER_OFFSET ((UPAGES * NBPG) - sizeof (struct user))
|
||||
#else
|
||||
/* dynix */
|
||||
#define HOST_TEXT_START_ADDR 0x1000
|
||||
#define HOST_DATA_START_ADDR (NBPG * u.u_tsize)
|
||||
#define HOST_STACK_END_ADDR 0x3ffff000
|
||||
#define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(core_bfd) \
|
||||
((core_bfd)->tdata.trad_core_data->u.u_arg[0])
|
||||
#endif
|
||||
|
||||
#define TRAD_CORE_DSIZE_INCLUDES_TSIZE
|
|
@ -0,0 +1,31 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#define NO_CORE_COMMAND
|
||||
|
||||
#undef ALIGN /* They use it, we use it too */
|
||||
#include <machine/param.h>
|
||||
#undef ALIGN /* They use it, we use it too */
|
||||
|
||||
#define HOST_PAGE_SIZE NBPG
|
||||
#define HOST_MACHINE_ARCH bfd_arch_tahoe
|
||||
|
||||
#define HOST_TEXT_START_ADDR 0
|
||||
#define HOST_STACK_END_ADDR (KERNBASE - (UPAGES * NBPG))
|
||||
#define HOST_BIG_ENDIAN_P
|
|
@ -0,0 +1,31 @@
|
|||
/* Copyright 2005, 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#define NO_CORE_COMMAND /* No command name in core file */
|
||||
|
||||
#undef ALIGN /* They use it, we use it too */
|
||||
|
||||
/* Note that HOST_PAGE_SIZE -- the page size as far as executable files
|
||||
are concerned -- is not the same as NBPG, because of page clustering. */
|
||||
#define HOST_PAGE_SIZE 1024
|
||||
#define HOST_MACHINE_ARCH bfd_arch_vax
|
||||
|
||||
#define HOST_TEXT_START_ADDR 0
|
||||
#define HOST_STACK_END_ADDR (0x80000000 - (UPAGES * NBPG))
|
||||
#undef HOST_BIG_ENDIAN_P
|
|
@ -0,0 +1,21 @@
|
|||
/* Copyright 2005, 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#define TRAD_CORE_EXTRA_SIZE_ALLOWED 4096
|
||||
#define HOST_MACHINE_ARCH bfd_arch_vax
|
|
@ -0,0 +1,27 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#include <machine/param.h>
|
||||
#include <machine/vmparam.h>
|
||||
#define HOST_PAGE_SIZE (NBPG*CLSIZE)
|
||||
#define HOST_MACHINE_ARCH bfd_arch_vax
|
||||
|
||||
#define HOST_TEXT_START_ADDR USRTEXT
|
||||
#define HOST_STACK_END_ADDR USRSTACK
|
||||
#undef HOST_BIG_ENDIAN_P
|
|
@ -0,0 +1,27 @@
|
|||
/* Copyright 2007 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#include <machine/param.h>
|
||||
#include <machine/vmparam.h>
|
||||
#define HOST_PAGE_SIZE (NBPG*CLSIZE)
|
||||
#define HOST_MACHINE_ARCH bfd_arch_vax
|
||||
|
||||
#define HOST_TEXT_START_ADDR USRTEXT
|
||||
#define HOST_STACK_END_ADDR USRSTACK
|
||||
#undef HOST_BIG_ENDIAN_P
|
|
@ -0,0 +1,195 @@
|
|||
/* Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* This is somewhat modelled after the file of the same name on SVR4
|
||||
systems. It provides a definition of the core file format for ELF
|
||||
used on Linux. It doesn't have anything to do with the /proc file
|
||||
system, even though Linux has one.
|
||||
|
||||
Anyway, the whole purpose of this file is for GDB and GDB only.
|
||||
Don't read too much into it. Don't use it for anything other than
|
||||
GDB unless you know what you are doing. */
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* We define here only the symbols differing from their 64-bit variant. */
|
||||
#include <sys/procfs.h>
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#else
|
||||
typedef unsigned int uint32_t;
|
||||
#endif
|
||||
|
||||
#undef HAVE_PRPSINFO32_T
|
||||
#define HAVE_PRPSINFO32_T
|
||||
|
||||
#undef HAVE_PRSTATUS32_T
|
||||
#define HAVE_PRSTATUS32_T
|
||||
|
||||
/* These are the 32-bit x86 structures. */
|
||||
|
||||
struct user_fpregs32_struct
|
||||
{
|
||||
int32_t cwd;
|
||||
int32_t swd;
|
||||
int32_t twd;
|
||||
int32_t fip;
|
||||
int32_t fcs;
|
||||
int32_t foo;
|
||||
int32_t fos;
|
||||
int32_t st_space [20];
|
||||
};
|
||||
|
||||
struct user_fpxregs32_struct
|
||||
{
|
||||
unsigned short int cwd;
|
||||
unsigned short int swd;
|
||||
unsigned short int twd;
|
||||
unsigned short int fop;
|
||||
int32_t fip;
|
||||
int32_t fcs;
|
||||
int32_t foo;
|
||||
int32_t fos;
|
||||
int32_t mxcsr;
|
||||
int32_t reserved;
|
||||
int32_t st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
|
||||
int32_t xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
|
||||
int32_t padding[56];
|
||||
};
|
||||
|
||||
struct user_regs32_struct
|
||||
{
|
||||
int32_t ebx;
|
||||
int32_t ecx;
|
||||
int32_t edx;
|
||||
int32_t esi;
|
||||
int32_t edi;
|
||||
int32_t ebp;
|
||||
int32_t eax;
|
||||
int32_t xds;
|
||||
int32_t xes;
|
||||
int32_t xfs;
|
||||
int32_t xgs;
|
||||
int32_t orig_eax;
|
||||
int32_t eip;
|
||||
int32_t xcs;
|
||||
int32_t eflags;
|
||||
int32_t esp;
|
||||
int32_t xss;
|
||||
};
|
||||
|
||||
struct user32
|
||||
{
|
||||
struct user_regs32_struct regs;
|
||||
int u_fpvalid;
|
||||
struct user_fpregs32_struct i387;
|
||||
uint32_t u_tsize;
|
||||
uint32_t u_dsize;
|
||||
uint32_t u_ssize;
|
||||
uint32_t start_code;
|
||||
uint32_t start_stack;
|
||||
int32_t signal;
|
||||
int reserved;
|
||||
struct user_regs32_struct* u_ar0;
|
||||
struct user_fpregs32_struct* u_fpstate;
|
||||
uint32_t magic;
|
||||
char u_comm [32];
|
||||
int u_debugreg [8];
|
||||
};
|
||||
|
||||
/* Type for a general-purpose register. */
|
||||
typedef unsigned int elf_greg32_t;
|
||||
|
||||
/* And the whole bunch of them. We could have used `struct
|
||||
user_regs_struct' directly in the typedef, but tradition says that
|
||||
the register set is an array, which does have some peculiar
|
||||
semantics, so leave it that way. */
|
||||
#define ELF_NGREG32 (sizeof (struct user_regs32_struct) / sizeof(elf_greg32_t))
|
||||
typedef elf_greg32_t elf_gregset32_t[ELF_NGREG32];
|
||||
|
||||
/* Register set for the floating-point registers. */
|
||||
typedef struct user_fpregs32_struct elf_fpregset32_t;
|
||||
|
||||
/* Register set for the extended floating-point registers. Includes
|
||||
the Pentium III SSE registers in addition to the classic
|
||||
floating-point stuff. */
|
||||
typedef struct user_fpxregs32_struct elf_fpxregset32_t;
|
||||
|
||||
|
||||
/* Definitions to generate Intel SVR4-like core files. These mostly
|
||||
have the same names as the SVR4 types with "elf_" tacked on the
|
||||
front to prevent clashes with Linux definitions, and the typedef
|
||||
forms have been avoided. This is mostly like the SVR4 structure,
|
||||
but more Linuxy, with things that Linux does not support and which
|
||||
GDB doesn't really use excluded. */
|
||||
|
||||
struct prstatus32_timeval
|
||||
{
|
||||
int tv_sec;
|
||||
int tv_usec;
|
||||
};
|
||||
|
||||
struct elf_prstatus32
|
||||
{
|
||||
struct elf_siginfo pr_info; /* Info associated with signal. */
|
||||
short int pr_cursig; /* Current signal. */
|
||||
unsigned int pr_sigpend; /* Set of pending signals. */
|
||||
unsigned int pr_sighold; /* Set of held signals. */
|
||||
__pid_t pr_pid;
|
||||
__pid_t pr_ppid;
|
||||
__pid_t pr_pgrp;
|
||||
__pid_t pr_sid;
|
||||
struct prstatus32_timeval pr_utime; /* User time. */
|
||||
struct prstatus32_timeval pr_stime; /* System time. */
|
||||
struct prstatus32_timeval pr_cutime; /* Cumulative user time. */
|
||||
struct prstatus32_timeval pr_cstime; /* Cumulative system time. */
|
||||
elf_gregset32_t pr_reg; /* GP registers. */
|
||||
int pr_fpvalid; /* True if math copro being used. */
|
||||
};
|
||||
|
||||
|
||||
struct elf_prpsinfo32
|
||||
{
|
||||
char pr_state; /* Numeric process state. */
|
||||
char pr_sname; /* Char for pr_state. */
|
||||
char pr_zomb; /* Zombie. */
|
||||
char pr_nice; /* Nice val. */
|
||||
unsigned int pr_flag; /* Flags. */
|
||||
unsigned short int pr_uid;
|
||||
unsigned short int pr_gid;
|
||||
int pr_pid, pr_ppid, pr_pgrp, pr_sid;
|
||||
/* Lots missing */
|
||||
char pr_fname[16]; /* Filename of executable. */
|
||||
char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
|
||||
};
|
||||
|
||||
|
||||
/* The rest of this file provides the types for emulation of the
|
||||
Solaris <proc_service.h> interfaces that should be implemented by
|
||||
users of libthread_db. */
|
||||
|
||||
/* Register sets. Linux has different names. */
|
||||
typedef elf_gregset_t prgregset32_t;
|
||||
typedef elf_fpregset_t prfpregset32_t;
|
||||
|
||||
/* Process status and info. In the end we do provide typedefs for them. */
|
||||
typedef struct elf_prstatus32 prstatus32_t;
|
||||
typedef struct elf_prpsinfo32 prpsinfo32_t;
|
|
@ -0,0 +1,10 @@
|
|||
bfd_stdint.h
|
||||
bfdver.h
|
||||
elf32-ia64.c
|
||||
elf32-target.h
|
||||
elf64-ia64.c
|
||||
elf64-target.h
|
||||
peigen.c
|
||||
pepigen.c
|
||||
pex64igen.c
|
||||
targmatch.h
|
|
@ -0,0 +1,298 @@
|
|||
# Makefile for program source directory in GNU NLS utilities package.
|
||||
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
# Copyright 2001, 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file may be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SHELL = /bin/sh
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
datadir = $(prefix)/@DATADIRNAME@
|
||||
localedir = $(datadir)/locale
|
||||
gnulocaledir = $(prefix)/share/locale
|
||||
gettextsrcdir = $(prefix)/share/gettext/po
|
||||
subdir = po
|
||||
|
||||
DESTDIR =
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
|
||||
CC = @CC@
|
||||
GENCAT = @GENCAT@
|
||||
GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
|
||||
MSGFMT = @MSGFMT@
|
||||
XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
|
||||
MSGMERGE = PATH=../src:$$PATH msgmerge
|
||||
|
||||
DEFS = @DEFS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
|
||||
INCLUDES = -I.. -I$(top_srcdir)/intl
|
||||
|
||||
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
||||
|
||||
SOURCES = cat-id-tbl.c
|
||||
POFILES = @POFILES@
|
||||
GMOFILES = @GMOFILES@
|
||||
DISTFILES = ChangeLog Makefile.in.in SRC-POTFILES.in BLD-POTFILES.in $(PACKAGE).pot \
|
||||
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
|
||||
|
||||
# Note - the following line gets processed by bfd/configure and amended
|
||||
# to contain the full list of source dir POTFILES.
|
||||
SRC-POTFILES = \
|
||||
|
||||
# Note - the following line gets processed by bfd/configure and amended
|
||||
# to contain the full list of build dir POTFILES.
|
||||
BLD-POTFILES = \
|
||||
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) $<
|
||||
|
||||
.po.pox:
|
||||
$(MAKE) $(PACKAGE).pot
|
||||
$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
|
||||
|
||||
.po.mo:
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
.po.gmo:
|
||||
file=`echo $* | sed 's,.*/,,'`.gmo \
|
||||
&& rm -f $$file && $(GMSGFMT) -o $$file $<
|
||||
|
||||
.po.cat:
|
||||
sed -f ../intl/po2msg.sed < $< > $*.msg \
|
||||
&& rm -f $@ && $(GENCAT) $@ $*.msg
|
||||
|
||||
|
||||
all: all-@USE_NLS@
|
||||
|
||||
all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot
|
||||
all-no:
|
||||
|
||||
$(srcdir)/$(PACKAGE).pot: $(SRC-POTFILES) $(BLD-POTFILES)
|
||||
$(XGETTEXT) --default-domain=$(PACKAGE) \
|
||||
--directory=$(top_srcdir) \
|
||||
--add-comments --keyword=_ --keyword=N_ \
|
||||
--msgid-bugs-address=bug-binutils@gnu.org \
|
||||
--files-from=$(srcdir)/SRC-POTFILES.in
|
||||
$(XGETTEXT) --default-domain=$(PACKAGE) \
|
||||
--directory=.. \
|
||||
--directory=. \
|
||||
--add-comments --keyword=_ --keyword=N_ \
|
||||
--join-existing \
|
||||
--msgid-bugs-address=bug-binutils@gnu.org \
|
||||
--files-from=$(srcdir)/BLD-POTFILES.in
|
||||
rm -f $(srcdir)/$(PACKAGE).pot
|
||||
mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
|
||||
|
||||
$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
|
||||
$(srcdir)/stamp-cat-id: $(PACKAGE).pot
|
||||
rm -f cat-id-tbl.tmp
|
||||
sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
|
||||
| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
|
||||
if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
|
||||
rm cat-id-tbl.tmp; \
|
||||
else \
|
||||
echo cat-id-tbl.c changed; \
|
||||
rm -f $(srcdir)/cat-id-tbl.c; \
|
||||
mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
|
||||
fi
|
||||
cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
|
||||
|
||||
|
||||
install: install-exec install-data
|
||||
install-exec:
|
||||
install-info:
|
||||
install-html:
|
||||
install-pdf:
|
||||
install-data: install-data-@USE_NLS@
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
|
||||
fi
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
case "$$cat" in \
|
||||
*.gmo) destdir=$(gnulocaledir);; \
|
||||
*) destdir=$(localedir);; \
|
||||
esac; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
$(MKINSTALLDIRS) $$dir; \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $$dir; \
|
||||
fi; \
|
||||
if test -r $$cat; then \
|
||||
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
||||
else \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
||||
fi; \
|
||||
if test -r $$cat.m; then \
|
||||
$(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
||||
else \
|
||||
if test -r $(srcdir)/$$cat.m ; then \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat.m \
|
||||
$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
||||
else \
|
||||
true; \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
|
||||
fi; \
|
||||
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
||||
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
||||
# Define this as empty until I found a useful application.
|
||||
installcheck:
|
||||
|
||||
uninstall:
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
||||
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
done
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in
|
||||
|
||||
check: all
|
||||
|
||||
cat-id-tbl.o: ../intl/libgettext.h
|
||||
|
||||
html dvi pdf ps info tags TAGS ID:
|
||||
|
||||
mostlyclean:
|
||||
rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
|
||||
rm -fr *.o
|
||||
|
||||
clean: mostlyclean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile Makefile.in *.mo *.msg *.cat *.cat.m
|
||||
rm -f SRC-POTFILES BLD-POTFILES
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
rm -f $(GMOFILES) SRC-POTFILES.in BLD-POTFILES.in
|
||||
|
||||
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir: update-po $(DISTFILES)
|
||||
dists="$(DISTFILES)"; \
|
||||
for file in $$dists; do \
|
||||
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir); \
|
||||
done
|
||||
|
||||
update-po: Makefile
|
||||
$(MAKE) $(PACKAGE).pot
|
||||
PATH=`pwd`/../src:$$PATH; \
|
||||
cd $(srcdir); \
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
mv $$lang.po $$lang.old.po; \
|
||||
echo "$$lang:"; \
|
||||
if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
|
||||
rm -f $$lang.old.po; \
|
||||
else \
|
||||
echo "msgmerge for $$cat failed!"; \
|
||||
rm -f $$lang.po; \
|
||||
mv $$lang.old.po $$lang.po; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
SRC-POTFILES: SRC-POTFILES.in
|
||||
( if test 'x$(srcdir)' != 'x.'; then \
|
||||
posrcprefix='$(top_srcdir)/'; \
|
||||
else \
|
||||
posrcprefix="../"; \
|
||||
fi; \
|
||||
rm -f $@-t $@ \
|
||||
&& (sed -e '/^#/d' \
|
||||
-e '/^[ ]*$$/d' \
|
||||
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
|
||||
| sed -e '$$s/\\$$//') > $@-t \
|
||||
&& chmod a-w $@-t \
|
||||
&& mv $@-t $@ )
|
||||
|
||||
BLD-POTFILES: BLD-POTFILES.in
|
||||
( rm -f $@-t $@ \
|
||||
&& (sed -e '/^#/d' \
|
||||
-e '/^[ ]*$$/d' \
|
||||
-e "s@.*@ ../& \\\\@" < $(srcdir)/$@.in \
|
||||
| sed -e '$$s/\\$$//') > $@-t \
|
||||
&& chmod a-w $@-t \
|
||||
&& mv $@-t $@ )
|
||||
|
||||
SRC-POTFILES.in: @MAINT@ ../Makefile
|
||||
cd .. && $(MAKE) po/SRC-POTFILES.in
|
||||
|
||||
BLD-POTFILES.in: @MAINT@ ../Makefile
|
||||
cd .. && $(MAKE) po/BLD-POTFILES.in
|
||||
|
||||
# Note - The presence of SRC-POTFILES and BLD-POTFILES as dependencies
|
||||
# here breaks the implementation of the 'distclean' rule for maintainers.
|
||||
# This is because if 'make distclean' is run in the BFD directory, the
|
||||
# Makefile there will be deleted before 'distclean' is made here, and so
|
||||
# the dependency SRC-POTFILES -> SRC-POTFILES.in -> ../Makefile cannot
|
||||
# be satisfied.
|
||||
#
|
||||
# The SRC-POTFILES and BLD-POTFILES dependencies cannot be removed,
|
||||
# however since it is necessary that these files be built during
|
||||
# *configure* time, so that configure can insert them into the
|
||||
# po/Makefile that it is creating, so that the Makefile will have
|
||||
# the correct dependencies.
|
||||
Makefile: Make-in ../config.status SRC-POTFILES BLD-POTFILES
|
||||
cd .. \
|
||||
&& CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
|
||||
CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,353 @@
|
|||
aix386-core.c
|
||||
aix5ppc-core.c
|
||||
aout-adobe.c
|
||||
aout-arm.c
|
||||
aout-cris.c
|
||||
aout-ns32k.c
|
||||
aout-sparcle.c
|
||||
aout-target.h
|
||||
aout-tic30.c
|
||||
aout0.c
|
||||
aout32.c
|
||||
aout64.c
|
||||
aoutf1.h
|
||||
aoutx.h
|
||||
archive.c
|
||||
archive64.c
|
||||
archures.c
|
||||
armnetbsd.c
|
||||
bfd.c
|
||||
bfdio.c
|
||||
bfdwin.c
|
||||
binary.c
|
||||
bout.c
|
||||
cache.c
|
||||
cf-i386lynx.c
|
||||
cf-sparclynx.c
|
||||
cisco-core.c
|
||||
coff-alpha.c
|
||||
coff-apollo.c
|
||||
coff-arm.c
|
||||
coff-aux.c
|
||||
coff-go32.c
|
||||
coff-h8300.c
|
||||
coff-h8500.c
|
||||
coff-i386.c
|
||||
coff-i860.c
|
||||
coff-i960.c
|
||||
coff-m68k.c
|
||||
coff-m88k.c
|
||||
coff-mips.c
|
||||
coff-or32.c
|
||||
coff-rs6000.c
|
||||
coff-sh.c
|
||||
coff-sparc.c
|
||||
coff-stgo32.c
|
||||
coff-svm68k.c
|
||||
coff-tic30.c
|
||||
coff-tic4x.c
|
||||
coff-tic54x.c
|
||||
coff-tic80.c
|
||||
coff-u68k.c
|
||||
coff-w65.c
|
||||
coff-we32k.c
|
||||
coff-x86_64.c
|
||||
coff-z80.c
|
||||
coff-z8k.c
|
||||
coff64-rs6000.c
|
||||
coffcode.h
|
||||
coffgen.c
|
||||
cofflink.c
|
||||
coffswap.h
|
||||
compress.c
|
||||
corefile.c
|
||||
cpu-alpha.c
|
||||
cpu-arc.c
|
||||
cpu-arm.c
|
||||
cpu-avr.c
|
||||
cpu-bfin.c
|
||||
cpu-cr16.c
|
||||
cpu-cr16c.c
|
||||
cpu-cris.c
|
||||
cpu-crx.c
|
||||
cpu-d10v.c
|
||||
cpu-d30v.c
|
||||
cpu-dlx.c
|
||||
cpu-fr30.c
|
||||
cpu-frv.c
|
||||
cpu-h8300.c
|
||||
cpu-h8500.c
|
||||
cpu-hppa.c
|
||||
cpu-i370.c
|
||||
cpu-i386.c
|
||||
cpu-i860.c
|
||||
cpu-i960.c
|
||||
cpu-ia64.c
|
||||
cpu-ip2k.c
|
||||
cpu-iq2000.c
|
||||
cpu-l1om.c
|
||||
cpu-lm32.c
|
||||
cpu-m10200.c
|
||||
cpu-m10300.c
|
||||
cpu-m32c.c
|
||||
cpu-m32r.c
|
||||
cpu-m68hc11.c
|
||||
cpu-m68hc12.c
|
||||
cpu-m68k.c
|
||||
cpu-m88k.c
|
||||
cpu-mcore.c
|
||||
cpu-mep.c
|
||||
cpu-microblaze.c
|
||||
cpu-mips.c
|
||||
cpu-mmix.c
|
||||
cpu-moxie.c
|
||||
cpu-msp430.c
|
||||
cpu-mt.c
|
||||
cpu-ns32k.c
|
||||
cpu-openrisc.c
|
||||
cpu-or32.c
|
||||
cpu-pdp11.c
|
||||
cpu-pj.c
|
||||
cpu-plugin.c
|
||||
cpu-powerpc.c
|
||||
cpu-rs6000.c
|
||||
cpu-rx.c
|
||||
cpu-s390.c
|
||||
cpu-score.c
|
||||
cpu-sh.c
|
||||
cpu-sparc.c
|
||||
cpu-spu.c
|
||||
cpu-tic30.c
|
||||
cpu-tic4x.c
|
||||
cpu-tic54x.c
|
||||
cpu-tic6x.c
|
||||
cpu-tic80.c
|
||||
cpu-v850.c
|
||||
cpu-vax.c
|
||||
cpu-w65.c
|
||||
cpu-we32k.c
|
||||
cpu-xc16x.c
|
||||
cpu-xstormy16.c
|
||||
cpu-xtensa.c
|
||||
cpu-z80.c
|
||||
cpu-z8k.c
|
||||
demo64.c
|
||||
dwarf1.c
|
||||
dwarf2.c
|
||||
ecoff.c
|
||||
ecofflink.c
|
||||
ecoffswap.h
|
||||
elf-attrs.c
|
||||
elf-bfd.h
|
||||
elf-eh-frame.c
|
||||
elf-hppa.h
|
||||
elf-ifunc.c
|
||||
elf-m10200.c
|
||||
elf-m10300.c
|
||||
elf-strtab.c
|
||||
elf-vxworks.c
|
||||
elf.c
|
||||
elf32-am33lin.c
|
||||
elf32-arc.c
|
||||
elf32-arm.c
|
||||
elf32-avr.c
|
||||
elf32-bfin.c
|
||||
elf32-cr16.c
|
||||
elf32-cr16c.c
|
||||
elf32-cris.c
|
||||
elf32-crx.c
|
||||
elf32-d10v.c
|
||||
elf32-d30v.c
|
||||
elf32-dlx.c
|
||||
elf32-fr30.c
|
||||
elf32-frv.c
|
||||
elf32-gen.c
|
||||
elf32-h8300.c
|
||||
elf32-hppa.c
|
||||
elf32-hppa.h
|
||||
elf32-i370.c
|
||||
elf32-i386.c
|
||||
elf32-i860.c
|
||||
elf32-i960.c
|
||||
elf32-ip2k.c
|
||||
elf32-iq2000.c
|
||||
elf32-lm32.c
|
||||
elf32-m32c.c
|
||||
elf32-m32r.c
|
||||
elf32-m68hc11.c
|
||||
elf32-m68hc12.c
|
||||
elf32-m68hc1x.c
|
||||
elf32-m68k.c
|
||||
elf32-m88k.c
|
||||
elf32-mcore.c
|
||||
elf32-mep.c
|
||||
elf32-microblaze.c
|
||||
elf32-mips.c
|
||||
elf32-moxie.c
|
||||
elf32-msp430.c
|
||||
elf32-mt.c
|
||||
elf32-openrisc.c
|
||||
elf32-or32.c
|
||||
elf32-pj.c
|
||||
elf32-ppc.c
|
||||
elf32-rx.c
|
||||
elf32-s390.c
|
||||
elf32-score.c
|
||||
elf32-score7.c
|
||||
elf32-sh-symbian.c
|
||||
elf32-sh.c
|
||||
elf32-sh64-com.c
|
||||
elf32-sh64.c
|
||||
elf32-sparc.c
|
||||
elf32-spu.c
|
||||
elf32-tic6x.c
|
||||
elf32-v850.c
|
||||
elf32-vax.c
|
||||
elf32-xc16x.c
|
||||
elf32-xstormy16.c
|
||||
elf32-xtensa.c
|
||||
elf32.c
|
||||
elf64-alpha.c
|
||||
elf64-gen.c
|
||||
elf64-hppa.c
|
||||
elf64-hppa.h
|
||||
elf64-mips.c
|
||||
elf64-mmix.c
|
||||
elf64-ppc.c
|
||||
elf64-s390.c
|
||||
elf64-sh64.c
|
||||
elf64-sparc.c
|
||||
elf64-x86-64.c
|
||||
elf64.c
|
||||
elfcode.h
|
||||
elfcore.h
|
||||
elflink.c
|
||||
elfn32-mips.c
|
||||
elfxx-mips.c
|
||||
elfxx-sparc.c
|
||||
epoc-pe-arm.c
|
||||
epoc-pei-arm.c
|
||||
format.c
|
||||
freebsd.h
|
||||
genlink.h
|
||||
go32stub.h
|
||||
hash.c
|
||||
hp300bsd.c
|
||||
hp300hpux.c
|
||||
hpux-core.c
|
||||
i386aout.c
|
||||
i386bsd.c
|
||||
i386dynix.c
|
||||
i386freebsd.c
|
||||
i386linux.c
|
||||
i386lynx.c
|
||||
i386mach3.c
|
||||
i386msdos.c
|
||||
i386netbsd.c
|
||||
i386os9k.c
|
||||
ieee.c
|
||||
ihex.c
|
||||
init.c
|
||||
irix-core.c
|
||||
libaout.h
|
||||
libbfd.c
|
||||
libbfd.h
|
||||
libcoff.h
|
||||
libecoff.h
|
||||
libhppa.h
|
||||
libieee.h
|
||||
libnlm.h
|
||||
liboasys.h
|
||||
libpei.h
|
||||
libxcoff.h
|
||||
linker.c
|
||||
lynx-core.c
|
||||
m68k4knetbsd.c
|
||||
m68klinux.c
|
||||
m68knetbsd.c
|
||||
m88kmach3.c
|
||||
m88kopenbsd.c
|
||||
mach-o-i386.c
|
||||
mach-o-x86-64.c
|
||||
mach-o.c
|
||||
mach-o.h
|
||||
merge.c
|
||||
mipsbsd.c
|
||||
mmo.c
|
||||
netbsd.h
|
||||
newsos3.c
|
||||
nlm-target.h
|
||||
nlm.c
|
||||
nlm32-alpha.c
|
||||
nlm32-i386.c
|
||||
nlm32-ppc.c
|
||||
nlm32-sparc.c
|
||||
nlm32.c
|
||||
nlm64.c
|
||||
nlmcode.h
|
||||
nlmswap.h
|
||||
ns32k.h
|
||||
ns32knetbsd.c
|
||||
oasys.c
|
||||
opncls.c
|
||||
osf-core.c
|
||||
pc532-mach.c
|
||||
pdp11.c
|
||||
pe-arm-wince.c
|
||||
pe-arm.c
|
||||
pe-i386.c
|
||||
pe-mcore.c
|
||||
pe-mips.c
|
||||
pe-ppc.c
|
||||
pe-sh.c
|
||||
pe-x86_64.c
|
||||
pef-traceback.h
|
||||
pef.c
|
||||
pef.h
|
||||
pei-arm-wince.c
|
||||
pei-arm.c
|
||||
pei-i386.c
|
||||
pei-ia64.c
|
||||
pei-mcore.c
|
||||
pei-mips.c
|
||||
pei-ppc.c
|
||||
pei-sh.c
|
||||
pei-x86_64.c
|
||||
peicode.h
|
||||
plugin.c
|
||||
ppcboot.c
|
||||
reloc.c
|
||||
reloc16.c
|
||||
riscix.c
|
||||
sco5-core.c
|
||||
section.c
|
||||
simple.c
|
||||
som.c
|
||||
som.h
|
||||
sparclinux.c
|
||||
sparclynx.c
|
||||
sparcnetbsd.c
|
||||
srec.c
|
||||
stab-syms.c
|
||||
stabs.c
|
||||
sunos.c
|
||||
syms.c
|
||||
targets.c
|
||||
tekhex.c
|
||||
trad-core.c
|
||||
vax1knetbsd.c
|
||||
vaxbsd.c
|
||||
vaxnetbsd.c
|
||||
verilog.c
|
||||
versados.c
|
||||
version.h
|
||||
vms-alpha.c
|
||||
vms-lib.c
|
||||
vms-misc.c
|
||||
vms.h
|
||||
xcoff-target.h
|
||||
xcofflink.c
|
||||
xsym.c
|
||||
xsym.h
|
||||
xtensa-isa.c
|
||||
xtensa-modules.c
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,340 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
See ../binutils/MAINTAINERS
|
|
@ -0,0 +1,45 @@
|
|||
#include "config.h"
|
||||
|
||||
/* This is a merge of code recommended in the autoconf-2.61 documentation
|
||||
with that recommended in the autoconf-2.13 documentation, with added
|
||||
tweaks to heed C_ALLOCA. */
|
||||
|
||||
#if defined HAVE_ALLOCA_H && !defined C_ALLOCA
|
||||
# include <alloca.h>
|
||||
#else
|
||||
# if defined __GNUC__ && !defined C_ALLOCA
|
||||
# if !defined alloca
|
||||
# define alloca __builtin_alloca
|
||||
# endif
|
||||
# else
|
||||
# if defined _AIX
|
||||
/* Indented so that pre-ansi C compilers will ignore it, rather than
|
||||
choke on it. Some versions of AIX require this to be the first
|
||||
thing seen by the compiler except for comments and preprocessor
|
||||
directives. */
|
||||
#pragma alloca
|
||||
# else
|
||||
# if defined _MSC_VER && !defined C_ALLOCA
|
||||
# include <malloc.h>
|
||||
# define alloca _alloca
|
||||
# else
|
||||
# if !defined alloca
|
||||
# if defined __STDC__ || defined __hpux
|
||||
# if defined HAVE_STDDEF_H
|
||||
# include <stddef.h>
|
||||
# if defined __cplusplus
|
||||
extern "C" void *alloca (size_t);
|
||||
# else
|
||||
extern void *alloca (size_t);
|
||||
# endif
|
||||
# else
|
||||
extern void *alloca ();
|
||||
# endif
|
||||
# else
|
||||
extern char *alloca ();
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
|
@ -0,0 +1,423 @@
|
|||
/* ANSI and traditional C compatability macros
|
||||
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* ANSI and traditional C compatibility macros
|
||||
|
||||
ANSI C is assumed if __STDC__ is #defined.
|
||||
|
||||
Macro ANSI C definition Traditional C definition
|
||||
----- ---- - ---------- ----------- - ----------
|
||||
ANSI_PROTOTYPES 1 not defined
|
||||
PTR `void *' `char *'
|
||||
PTRCONST `void *const' `char *'
|
||||
LONG_DOUBLE `long double' `double'
|
||||
const not defined `'
|
||||
volatile not defined `'
|
||||
signed not defined `'
|
||||
VA_START(ap, var) va_start(ap, var) va_start(ap)
|
||||
|
||||
Note that it is safe to write "void foo();" indicating a function
|
||||
with no return value, in all K+R compilers we have been able to test.
|
||||
|
||||
For declaring functions with prototypes, we also provide these:
|
||||
|
||||
PARAMS ((prototype))
|
||||
-- for functions which take a fixed number of arguments. Use this
|
||||
when declaring the function. When defining the function, write a
|
||||
K+R style argument list. For example:
|
||||
|
||||
char *strcpy PARAMS ((char *dest, char *source));
|
||||
...
|
||||
char *
|
||||
strcpy (dest, source)
|
||||
char *dest;
|
||||
char *source;
|
||||
{ ... }
|
||||
|
||||
|
||||
VPARAMS ((prototype, ...))
|
||||
-- for functions which take a variable number of arguments. Use
|
||||
PARAMS to declare the function, VPARAMS to define it. For example:
|
||||
|
||||
int printf PARAMS ((const char *format, ...));
|
||||
...
|
||||
int
|
||||
printf VPARAMS ((const char *format, ...))
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
For writing functions which take variable numbers of arguments, we
|
||||
also provide the VA_OPEN, VA_CLOSE, and VA_FIXEDARG macros. These
|
||||
hide the differences between K+R <varargs.h> and C89 <stdarg.h> more
|
||||
thoroughly than the simple VA_START() macro mentioned above.
|
||||
|
||||
VA_OPEN and VA_CLOSE are used *instead of* va_start and va_end.
|
||||
Immediately after VA_OPEN, put a sequence of VA_FIXEDARG calls
|
||||
corresponding to the list of fixed arguments. Then use va_arg
|
||||
normally to get the variable arguments, or pass your va_list object
|
||||
around. You do not declare the va_list yourself; VA_OPEN does it
|
||||
for you.
|
||||
|
||||
Here is a complete example:
|
||||
|
||||
int
|
||||
printf VPARAMS ((const char *format, ...))
|
||||
{
|
||||
int result;
|
||||
|
||||
VA_OPEN (ap, format);
|
||||
VA_FIXEDARG (ap, const char *, format);
|
||||
|
||||
result = vfprintf (stdout, format, ap);
|
||||
VA_CLOSE (ap);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
You can declare variables either before or after the VA_OPEN,
|
||||
VA_FIXEDARG sequence. Also, VA_OPEN and VA_CLOSE are the beginning
|
||||
and end of a block. They must appear at the same nesting level,
|
||||
and any variables declared after VA_OPEN go out of scope at
|
||||
VA_CLOSE. Unfortunately, with a K+R compiler, that includes the
|
||||
argument list. You can have multiple instances of VA_OPEN/VA_CLOSE
|
||||
pairs in a single function in case you need to traverse the
|
||||
argument list more than once.
|
||||
|
||||
For ease of writing code which uses GCC extensions but needs to be
|
||||
portable to other compilers, we provide the GCC_VERSION macro that
|
||||
simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various
|
||||
wrappers around __attribute__. Also, __extension__ will be #defined
|
||||
to nothing if it doesn't work. See below.
|
||||
|
||||
This header also defines a lot of obsolete macros:
|
||||
CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID,
|
||||
AND, DOTS, NOARGS. Don't use them. */
|
||||
|
||||
#ifndef _ANSIDECL_H
|
||||
#define _ANSIDECL_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Every source file includes this file,
|
||||
so they will all get the switch for lint. */
|
||||
/* LINTLIBRARY */
|
||||
|
||||
/* Using MACRO(x,y) in cpp #if conditionals does not work with some
|
||||
older preprocessors. Thus we can't define something like this:
|
||||
|
||||
#define HAVE_GCC_VERSION(MAJOR, MINOR) \
|
||||
(__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
|
||||
|
||||
and then test "#if HAVE_GCC_VERSION(2,7)".
|
||||
|
||||
So instead we use the macro below and test it against specific values. */
|
||||
|
||||
/* This macro simplifies testing whether we are using gcc, and if it
|
||||
is of a particular minimum version. (Both major & minor numbers are
|
||||
significant.) This macro will evaluate to 0 if we are not using
|
||||
gcc at all. */
|
||||
#ifndef GCC_VERSION
|
||||
#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
|
||||
#endif /* GCC_VERSION */
|
||||
|
||||
#if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
|
||||
/* All known AIX compilers implement these things (but don't always
|
||||
define __STDC__). The RISC/OS MIPS compiler defines these things
|
||||
in SVR4 mode, but does not define __STDC__. */
|
||||
/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other
|
||||
C++ compilers, does not define __STDC__, though it acts as if this
|
||||
was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
|
||||
|
||||
#define ANSI_PROTOTYPES 1
|
||||
#define PTR void *
|
||||
#define PTRCONST void *const
|
||||
#define LONG_DOUBLE long double
|
||||
|
||||
/* PARAMS is often defined elsewhere (e.g. by libintl.h), so wrap it in
|
||||
a #ifndef. */
|
||||
#ifndef PARAMS
|
||||
#define PARAMS(ARGS) ARGS
|
||||
#endif
|
||||
|
||||
#define VPARAMS(ARGS) ARGS
|
||||
#define VA_START(VA_LIST, VAR) va_start(VA_LIST, VAR)
|
||||
|
||||
/* variadic function helper macros */
|
||||
/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's
|
||||
use without inhibiting further decls and without declaring an
|
||||
actual variable. */
|
||||
#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP, VAR); { struct Qdmy
|
||||
#define VA_CLOSE(AP) } va_end(AP); }
|
||||
#define VA_FIXEDARG(AP, T, N) struct Qdmy
|
||||
|
||||
#undef const
|
||||
#undef volatile
|
||||
#undef signed
|
||||
|
||||
/* inline requires special treatment; it's in C99, and GCC >=2.7 supports
|
||||
it too, but it's not in C89. */
|
||||
#undef inline
|
||||
#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__))
|
||||
/* it's a keyword */
|
||||
#else
|
||||
# if GCC_VERSION >= 2007
|
||||
# define inline __inline__ /* __inline__ prevents -pedantic warnings */
|
||||
# else
|
||||
# define inline /* nothing */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* These are obsolete. Do not use. */
|
||||
#ifndef IN_GCC
|
||||
#define CONST const
|
||||
#define VOLATILE volatile
|
||||
#define SIGNED signed
|
||||
|
||||
#define PROTO(type, name, arglist) type name arglist
|
||||
#define EXFUN(name, proto) name proto
|
||||
#define DEFUN(name, arglist, args) name(args)
|
||||
#define DEFUN_VOID(name) name(void)
|
||||
#define AND ,
|
||||
#define DOTS , ...
|
||||
#define NOARGS void
|
||||
#endif /* ! IN_GCC */
|
||||
|
||||
#else /* Not ANSI C. */
|
||||
|
||||
#undef ANSI_PROTOTYPES
|
||||
#define PTR char *
|
||||
#define PTRCONST PTR
|
||||
#define LONG_DOUBLE double
|
||||
|
||||
#define PARAMS(args) ()
|
||||
#define VPARAMS(args) (va_alist) va_dcl
|
||||
#define VA_START(va_list, var) va_start(va_list)
|
||||
|
||||
#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP); { struct Qdmy
|
||||
#define VA_CLOSE(AP) } va_end(AP); }
|
||||
#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE)
|
||||
|
||||
/* some systems define these in header files for non-ansi mode */
|
||||
#undef const
|
||||
#undef volatile
|
||||
#undef signed
|
||||
#undef inline
|
||||
#define const
|
||||
#define volatile
|
||||
#define signed
|
||||
#define inline
|
||||
|
||||
#ifndef IN_GCC
|
||||
#define CONST
|
||||
#define VOLATILE
|
||||
#define SIGNED
|
||||
|
||||
#define PROTO(type, name, arglist) type name ()
|
||||
#define EXFUN(name, proto) name()
|
||||
#define DEFUN(name, arglist, args) name arglist args;
|
||||
#define DEFUN_VOID(name) name()
|
||||
#define AND ;
|
||||
#define DOTS
|
||||
#define NOARGS
|
||||
#endif /* ! IN_GCC */
|
||||
|
||||
#endif /* ANSI C. */
|
||||
|
||||
/* Define macros for some gcc attributes. This permits us to use the
|
||||
macros freely, and know that they will come into play for the
|
||||
version of gcc in which they are supported. */
|
||||
|
||||
#if (GCC_VERSION < 2007)
|
||||
# define __attribute__(x)
|
||||
#endif
|
||||
|
||||
/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
|
||||
#ifndef ATTRIBUTE_MALLOC
|
||||
# if (GCC_VERSION >= 2096)
|
||||
# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
|
||||
# else
|
||||
# define ATTRIBUTE_MALLOC
|
||||
# endif /* GNUC >= 2.96 */
|
||||
#endif /* ATTRIBUTE_MALLOC */
|
||||
|
||||
/* Attributes on labels were valid as of gcc 2.93 and g++ 4.5. For
|
||||
g++ an attribute on a label must be followed by a semicolon. */
|
||||
#ifndef ATTRIBUTE_UNUSED_LABEL
|
||||
# ifndef __cplusplus
|
||||
# if GCC_VERSION >= 2093
|
||||
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
|
||||
# else
|
||||
# define ATTRIBUTE_UNUSED_LABEL
|
||||
# endif
|
||||
# else
|
||||
# if GCC_VERSION >= 4005
|
||||
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED ;
|
||||
# else
|
||||
# define ATTRIBUTE_UNUSED_LABEL
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
|
||||
#endif /* ATTRIBUTE_UNUSED */
|
||||
|
||||
/* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the
|
||||
identifier name. */
|
||||
#if ! defined(__cplusplus) || (GCC_VERSION >= 3004)
|
||||
# define ARG_UNUSED(NAME) NAME ATTRIBUTE_UNUSED
|
||||
#else /* !__cplusplus || GNUC >= 3.4 */
|
||||
# define ARG_UNUSED(NAME) NAME
|
||||
#endif /* !__cplusplus || GNUC >= 3.4 */
|
||||
|
||||
#ifndef ATTRIBUTE_NORETURN
|
||||
#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
|
||||
#endif /* ATTRIBUTE_NORETURN */
|
||||
|
||||
/* Attribute `nonnull' was valid as of gcc 3.3. */
|
||||
#ifndef ATTRIBUTE_NONNULL
|
||||
# if (GCC_VERSION >= 3003)
|
||||
# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
|
||||
# else
|
||||
# define ATTRIBUTE_NONNULL(m)
|
||||
# endif /* GNUC >= 3.3 */
|
||||
#endif /* ATTRIBUTE_NONNULL */
|
||||
|
||||
/* Attribute `pure' was valid as of gcc 3.0. */
|
||||
#ifndef ATTRIBUTE_PURE
|
||||
# if (GCC_VERSION >= 3000)
|
||||
# define ATTRIBUTE_PURE __attribute__ ((__pure__))
|
||||
# else
|
||||
# define ATTRIBUTE_PURE
|
||||
# endif /* GNUC >= 3.0 */
|
||||
#endif /* ATTRIBUTE_PURE */
|
||||
|
||||
/* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL.
|
||||
This was the case for the `printf' format attribute by itself
|
||||
before GCC 3.3, but as of 3.3 we need to add the `nonnull'
|
||||
attribute to retain this behavior. */
|
||||
#ifndef ATTRIBUTE_PRINTF
|
||||
#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m)
|
||||
#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
|
||||
#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
|
||||
#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
|
||||
#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
|
||||
#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
|
||||
#endif /* ATTRIBUTE_PRINTF */
|
||||
|
||||
/* Use ATTRIBUTE_FPTR_PRINTF when the format attribute is to be set on
|
||||
a function pointer. Format attributes were allowed on function
|
||||
pointers as of gcc 3.1. */
|
||||
#ifndef ATTRIBUTE_FPTR_PRINTF
|
||||
# if (GCC_VERSION >= 3001)
|
||||
# define ATTRIBUTE_FPTR_PRINTF(m, n) ATTRIBUTE_PRINTF(m, n)
|
||||
# else
|
||||
# define ATTRIBUTE_FPTR_PRINTF(m, n)
|
||||
# endif /* GNUC >= 3.1 */
|
||||
# define ATTRIBUTE_FPTR_PRINTF_1 ATTRIBUTE_FPTR_PRINTF(1, 2)
|
||||
# define ATTRIBUTE_FPTR_PRINTF_2 ATTRIBUTE_FPTR_PRINTF(2, 3)
|
||||
# define ATTRIBUTE_FPTR_PRINTF_3 ATTRIBUTE_FPTR_PRINTF(3, 4)
|
||||
# define ATTRIBUTE_FPTR_PRINTF_4 ATTRIBUTE_FPTR_PRINTF(4, 5)
|
||||
# define ATTRIBUTE_FPTR_PRINTF_5 ATTRIBUTE_FPTR_PRINTF(5, 6)
|
||||
#endif /* ATTRIBUTE_FPTR_PRINTF */
|
||||
|
||||
/* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A
|
||||
NULL format specifier was allowed as of gcc 3.3. */
|
||||
#ifndef ATTRIBUTE_NULL_PRINTF
|
||||
# if (GCC_VERSION >= 3003)
|
||||
# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
|
||||
# else
|
||||
# define ATTRIBUTE_NULL_PRINTF(m, n)
|
||||
# endif /* GNUC >= 3.3 */
|
||||
# define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2)
|
||||
# define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3)
|
||||
# define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4)
|
||||
# define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5)
|
||||
# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)
|
||||
#endif /* ATTRIBUTE_NULL_PRINTF */
|
||||
|
||||
/* Attribute `sentinel' was valid as of gcc 3.5. */
|
||||
#ifndef ATTRIBUTE_SENTINEL
|
||||
# if (GCC_VERSION >= 3005)
|
||||
# define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
|
||||
# else
|
||||
# define ATTRIBUTE_SENTINEL
|
||||
# endif /* GNUC >= 3.5 */
|
||||
#endif /* ATTRIBUTE_SENTINEL */
|
||||
|
||||
|
||||
#ifndef ATTRIBUTE_ALIGNED_ALIGNOF
|
||||
# if (GCC_VERSION >= 3000)
|
||||
# define ATTRIBUTE_ALIGNED_ALIGNOF(m) __attribute__ ((__aligned__ (__alignof__ (m))))
|
||||
# else
|
||||
# define ATTRIBUTE_ALIGNED_ALIGNOF(m)
|
||||
# endif /* GNUC >= 3.0 */
|
||||
#endif /* ATTRIBUTE_ALIGNED_ALIGNOF */
|
||||
|
||||
/* Useful for structures whose layout must much some binary specification
|
||||
regardless of the alignment and padding qualities of the compiler. */
|
||||
#ifndef ATTRIBUTE_PACKED
|
||||
# define ATTRIBUTE_PACKED __attribute__ ((packed))
|
||||
#endif
|
||||
|
||||
/* Attribute `hot' and `cold' was valid as of gcc 4.3. */
|
||||
#ifndef ATTRIBUTE_COLD
|
||||
# if (GCC_VERSION >= 4003)
|
||||
# define ATTRIBUTE_COLD __attribute__ ((__cold__))
|
||||
# else
|
||||
# define ATTRIBUTE_COLD
|
||||
# endif /* GNUC >= 4.3 */
|
||||
#endif /* ATTRIBUTE_COLD */
|
||||
#ifndef ATTRIBUTE_HOT
|
||||
# if (GCC_VERSION >= 4003)
|
||||
# define ATTRIBUTE_HOT __attribute__ ((__hot__))
|
||||
# else
|
||||
# define ATTRIBUTE_HOT
|
||||
# endif /* GNUC >= 4.3 */
|
||||
#endif /* ATTRIBUTE_HOT */
|
||||
|
||||
/* We use __extension__ in some places to suppress -pedantic warnings
|
||||
about GCC extensions. This feature didn't work properly before
|
||||
gcc 2.8. */
|
||||
#if GCC_VERSION < 2008
|
||||
#define __extension__
|
||||
#endif
|
||||
|
||||
/* This is used to declare a const variable which should be visible
|
||||
outside of the current compilation unit. Use it as
|
||||
EXPORTED_CONST int i = 1;
|
||||
This is because the semantics of const are different in C and C++.
|
||||
"extern const" is permitted in C but it looks strange, and gcc
|
||||
warns about it when -Wc++-compat is not used. */
|
||||
#ifdef __cplusplus
|
||||
#define EXPORTED_CONST extern const
|
||||
#else
|
||||
#define EXPORTED_CONST const
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ansidecl.h */
|
|
@ -0,0 +1,253 @@
|
|||
2010-04-15 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* adobe.h: Update copyright notice to use GPLv3.
|
||||
* aout64.h: Likewise.
|
||||
* ar.h: Likewise.
|
||||
* dynix3.h: Likewise.
|
||||
* encap.h: Likewise.
|
||||
* host.h: Likewise.
|
||||
* hp.h: Likewise.
|
||||
* hp300hpux.h: Likewise.
|
||||
* ranlib.h: Likewise.
|
||||
* reloc.h: Likewise.
|
||||
* stab.def: Likewise.
|
||||
* stab_gnu.h: Likewise.
|
||||
* sun4.h: Likewise.
|
||||
|
||||
2009-10-02 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* aout64.h (N_SHARED_LIB): Define as zero if not already defined.
|
||||
* sun4.h (N_SHARED_LIB): Define.
|
||||
* hp300hpux.h (N_SHARED_LIB): Don't define.
|
||||
|
||||
2008-08-28 Tristan Gingold <gingold@adacore.com>
|
||||
|
||||
* stab.def: Add BNSYM, ENSYM, OSO for darwin.
|
||||
|
||||
2008-03-27 Cary Coutant <ccoutant@google.com>
|
||||
|
||||
* ar.h (ARMAGT): New magic string for thin archives.
|
||||
|
||||
2005-08-18 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* encap.h: Remove a29k support.
|
||||
|
||||
2005-05-10 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* Update the address and phone number of the FSF organization in
|
||||
the GPL notices in the following files:
|
||||
adobe.h, aout64.h, ar.h, dynix3.h, encap.h, host.h, hp.h,
|
||||
ranlib.h, reloc.h, stab.def, stab_gnu.h, sun4.h
|
||||
|
||||
2004-01-06 Mark Kettenis <kettenis@gnu.org>
|
||||
|
||||
* stab.def: Add N_PATCH to DO definition.
|
||||
|
||||
2003-03-06 Elias Athanasopoulos <elathan@phys.uoa.gr>
|
||||
|
||||
* aout64.h (BYTES_IN_WORD): Define if necessary.
|
||||
|
||||
2001-09-18 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* aout64.h: Formatting fixes.
|
||||
(N_TXTADDR): Evaluate to a bfd_vma.
|
||||
(N_DATADDR): Avoid negative unsigned warning.
|
||||
* hp300hpux.h: Formatting fixes.
|
||||
(N_DATADDR): Avoid negative unsigned warning.
|
||||
|
||||
2000-04-03 Hans-Peter Nilsson <hp@axis.com>
|
||||
|
||||
* aout64.h (RELOC_EXT_BITS_EXTERN_BIG): Wrap definition in #ifndef.
|
||||
(RELOC_EXT_BITS_EXTERN_LITTLE): Ditto.
|
||||
(RELOC_EXT_BITS_TYPE_BIG): Ditto.
|
||||
(RELOC_EXT_BITS_TYPE_SH_BIG): Ditto.
|
||||
(RELOC_EXT_BITS_TYPE_LITTLE): Ditto.
|
||||
(RELOC_EXT_BITS_TYPE_SH_LITTLE): Ditto.
|
||||
|
||||
1999-07-12 Ian Lance Taylor <ian@zembu.com>
|
||||
|
||||
* aout64.h (N_SHARED_LIB): Define as 0 if TEXT_START_ADDR is
|
||||
defined as 0.
|
||||
|
||||
1998-06-28 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
|
||||
|
||||
* stab.def: Add N_ALIAS from SunPro F77.
|
||||
|
||||
1996-03-11 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* stab.def: Use __define_stab_duplicate rather than __define_stab
|
||||
for duplicate entries N_BROWS and N_MOD2.
|
||||
* stab_gnu.h (__define_stab_duplicate): Define before including
|
||||
stab.def.
|
||||
|
||||
1995-10-27 Niklas Hallqvist <niklas@appli.se>
|
||||
|
||||
* aout64.h, host.h, hp300hpux.h, sun4.h: Changed PAGE_SIZE to
|
||||
TARGET_PAGE_SIZE.
|
||||
|
||||
1995-09-12 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* sun4.h (struct internal_sun4_dynamic_link): Change all fields
|
||||
from long to unsigned long.
|
||||
|
||||
1995-07-12 Ken Raeburn <raeburn@kr-pc.cygnus.com>
|
||||
|
||||
* sun4.h (PAGE_SIZE): Undefine before defining.
|
||||
|
||||
1994-09-04 Richard Earnshaw (rwe@pegasus.esprit.ec.org)
|
||||
|
||||
* aout64.h: Only define QMAGIC if it isn't already defined.
|
||||
|
||||
1994-06-16 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||
|
||||
* aout64.h (BMAGIC): Define.
|
||||
|
||||
1994-06-11 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||
|
||||
Add weak symbols as an extension to a.out.
|
||||
* aout64.h (N_WEAKU, N_WEAKA, N_WEAKT, N_WEAKD, N_WEAKB): Define.
|
||||
* stab.def: Update symbol value table.
|
||||
|
||||
1994-06-02 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||
|
||||
* sun4.h (EXTERNAL_SUN4_DYNAMIC_DEBUGGER_SIZE): Correct from 28 to
|
||||
24. Fix up ld_got comment.
|
||||
|
||||
1994-03-30 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
|
||||
|
||||
* dynix3.h: Cleanup, adapt to current bfd version.
|
||||
|
||||
1994-02-26 Ian Lance Taylor (ian@cygnus.com)
|
||||
|
||||
* aout64.h: Add casts to avoid warnings from SVR4 cc.
|
||||
|
||||
1994-02-11 Stan Shebs (shebs@andros.cygnus.com)
|
||||
|
||||
* ar.h (ARMAG, ARMAGB, ARFMAG): Change '\n' to '\012', for greater
|
||||
portability.
|
||||
|
||||
1994-01-21 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||
|
||||
* sun4.h: Added information about SunOS shared libraries.
|
||||
|
||||
1994-01-07 Jim Kingdon (kingdon@deneb.cygnus.com)
|
||||
|
||||
* aout64.h (N_TXTADDR): Add comment regarding OMAGIC and NMAGIC.
|
||||
|
||||
1993-12-25 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* aout64.h (N_DATOFF): Don't pad (revert change of 8 Jul 1993).
|
||||
|
||||
1993-11-16 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* aout64.h: New macros ZMAGIC_DISK_BLOCK_SIZE and N_DISK_BLOCK_SIZE
|
||||
for Linux ZMAGIC.
|
||||
(N_TXTOFF, N_DATOFF): Use them.
|
||||
|
||||
1993-11-04 Ken Raeburn (raeburn@kr-pc.cygnus.com)
|
||||
|
||||
* aout64.h (RELOC_STD_BITS_RELATIVE_LITTLE): Fixed value to match
|
||||
sun3 system; used to overlap other fields.
|
||||
(RELOC_STD_BITS_JMPTABLE_LITTLE): Likewise.
|
||||
|
||||
1993-11-03 David J. Mackenzie (djm@thepub.cygnus.com)
|
||||
|
||||
* aout64.h (RELOC_STD_BITS_BASEREL_LITTLE): Make it 0x10 (Ken's
|
||||
suggestion) to avoid conflict with RELOC_STD_BITS_EXTERN_LITTLE.
|
||||
|
||||
1993-10-29 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||
|
||||
* hp300hpux.h (N_SHARED_LIB): Define to be 0.
|
||||
|
||||
1993-09-13 John Gilmore (gnu@cygnus.com)
|
||||
|
||||
* ar.h (ARMAP_TIME_OFFSET): Add and describe.
|
||||
|
||||
Mon Aug 23 Sean Fagan (sef@cygnus.com)
|
||||
|
||||
* aout64.h [ARCH_SIZE != 64]: Allow N_BADMAG to be overridden.
|
||||
|
||||
1993-08-16 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* stab_gnu.h: Include aout/stab.def not just stab.def.
|
||||
|
||||
1993-07-18 Jim Kingdon (kingdon@rtl.cygnus.com)
|
||||
|
||||
* dynix3.h: New, for symmetry running dynix.
|
||||
|
||||
1993-07-08 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* aout64.h (N_BADMAG): Recognize QMAGIC.
|
||||
N_TXTOFF, N_TXTADDR, N_TXTSIZE: Special code for QMAGIC.
|
||||
N_DATOFF: Pad text size if we need to.
|
||||
|
||||
1993-06-18 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
||||
* stab.def (N_ECOML): Fix comment.
|
||||
|
||||
1993-05-31 Jim Kingdon (kingdon@cygnus.com)
|
||||
|
||||
* stab.def: Remove Solaris information on N_FUN stabstring grammar;
|
||||
I've transferred it to gdb/doc/stabs.texinfo, where it belongs.
|
||||
|
||||
1993-05-10 Ken Raeburn (raeburn@kr-pc.cygnus.com)
|
||||
|
||||
* hp300hpux.h: Patch from Glenn Engel for linker problem and
|
||||
compatibility fix:
|
||||
(OMAGIC, NMAGIC): New definitions.
|
||||
(SHAREMAGIC): Deleted.
|
||||
(HPUX_DOT_O_MAGIC): New macro.
|
||||
(_N_BADMAG): Adjusted.
|
||||
(N_HEADER_IN_TEXT, N_DATADDR): New macros.
|
||||
|
||||
1993-04-29 Ken Raeburn (raeburn@deneb.cygnus.com)
|
||||
|
||||
* hp300hpux.h: New file from Glenn Engel, glenne@lsid.hp.com.
|
||||
|
||||
1993-04-27 Ken Raeburn (raeburn@kr-pc.cygnus.com)
|
||||
|
||||
* aout64.h (struct external_exec, *MAGIC, N_BADMAG): Don't define
|
||||
if `external_exec' is already defined as a macro.
|
||||
(N_DATOFF, N_TRELOFF, N_DRELOFF, N_SYMOFF, N_STROFF): Don't define
|
||||
if already defined.
|
||||
(struct external_nlist, EXTERNAL_NLIST_SIZE): Don't define if
|
||||
`external_nlist' is already defined as a macro.
|
||||
|
||||
1992-08-15 John Gilmore (gnu@cygnus.com)
|
||||
|
||||
* adobe.h: Add description of a.out.adobe format.
|
||||
|
||||
1992-07-03 John Gilmore (gnu at cygnus.com)
|
||||
|
||||
* stab.def: Update more Solaris definitions.
|
||||
* stab_gnu.h: Add N_SO language types, and Solaris basic float types.
|
||||
|
||||
1992-06-14 John Gilmore (gnu at cygnus.com)
|
||||
|
||||
* stab.def: Update descriptions of Solaris-2 stabs; add N_UNDF.
|
||||
|
||||
1992-06-11 John Gilmore (gnu at cygnus.com)
|
||||
|
||||
* stab.def: Add N_OBJ and N_OPT from Solaris-2.
|
||||
|
||||
1992-01-30 John Gilmore (gnu at cygnus.com)
|
||||
|
||||
* aout64.h: N_TXTSIZE needs some more parentheses.
|
||||
I don't trust C precedence.
|
||||
|
||||
1991-12-18 Per Bothner (bothner at cygnus.com)
|
||||
|
||||
* aout64.h: Move common sunos-specific test
|
||||
to recognize shared libraries into new macro N_SHARED_LIB.
|
||||
Use it to simplify & reformat N_TXTADDR, N_TXTOFF, N_TXTSIZE.
|
||||
|
||||
1991-11-30 Steve Chamberlain (sac at rtl.cygnus.com)
|
||||
|
||||
* aout64.h, ar.h, encap.h, host.h, hp.h, ranlib.h, reloc.h,
|
||||
stab.def, stab_gnu.h, sun4.h: All moved from the devo/include
|
||||
directory.
|
||||
|
||||
|
||||
Local Variables:
|
||||
version-control: never
|
||||
End:
|
|
@ -0,0 +1,314 @@
|
|||
/* `a.out.adobe' differences from standard a.out files
|
||||
|
||||
Copyright 2001, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#ifndef __A_OUT_ADOBE_H__
|
||||
#define __A_OUT_ADOBE_H__
|
||||
|
||||
#define BYTES_IN_WORD 4
|
||||
|
||||
/* Struct external_exec is the same. */
|
||||
|
||||
/* This is the layout on disk of the 32-bit or 64-bit exec header. */
|
||||
|
||||
struct external_exec
|
||||
{
|
||||
bfd_byte e_info[4]; /* magic number and stuff */
|
||||
bfd_byte e_text[BYTES_IN_WORD]; /* length of text section in bytes */
|
||||
bfd_byte e_data[BYTES_IN_WORD]; /* length of data section in bytes */
|
||||
bfd_byte e_bss[BYTES_IN_WORD]; /* length of bss area in bytes */
|
||||
bfd_byte e_syms[BYTES_IN_WORD]; /* length of symbol table in bytes */
|
||||
bfd_byte e_entry[BYTES_IN_WORD]; /* start address */
|
||||
bfd_byte e_trsize[BYTES_IN_WORD]; /* length of text relocation info */
|
||||
bfd_byte e_drsize[BYTES_IN_WORD]; /* length of data relocation info */
|
||||
};
|
||||
|
||||
#define EXEC_BYTES_SIZE (4 + BYTES_IN_WORD * 7)
|
||||
|
||||
/* Magic numbers for a.out files */
|
||||
|
||||
#undef ZMAGIC
|
||||
#define ZMAGIC 0xAD0BE /* Cute, eh? */
|
||||
#undef OMAGIC
|
||||
#undef NMAGIC
|
||||
|
||||
#define N_BADMAG(x) ((x).a_info != ZMAGIC)
|
||||
|
||||
/* By default, segment size is constant. But some machines override this
|
||||
to be a function of the a.out header (e.g. machine type). */
|
||||
#ifndef N_SEGSIZE
|
||||
#define N_SEGSIZE(x) SEGMENT_SIZE
|
||||
#endif
|
||||
#undef N_SEGSIZE /* FIXMEXXXX */
|
||||
|
||||
/* Segment information for the a.out.Adobe format is specified after the
|
||||
file header. It contains N segment descriptors, followed by one with
|
||||
a type of zero.
|
||||
|
||||
The actual text of the segments starts at N_TXTOFF in the file,
|
||||
regardless of how many or how few segment headers there are. */
|
||||
|
||||
struct external_segdesc {
|
||||
unsigned char e_type[1];
|
||||
unsigned char e_size[3];
|
||||
unsigned char e_virtbase[4];
|
||||
unsigned char e_filebase[4];
|
||||
};
|
||||
|
||||
struct internal_segdesc {
|
||||
unsigned int a_type:8; /* Segment type N_TEXT, N_DATA, 0 */
|
||||
unsigned int a_size:24; /* Segment size */
|
||||
bfd_vma a_virtbase; /* Virtual address */
|
||||
unsigned int a_filebase; /* Base address in object file */
|
||||
};
|
||||
|
||||
#define N_TXTADDR(x) \
|
||||
|
||||
/* This is documented to be at 1024, but appears to really be at 2048.
|
||||
FIXME?! */
|
||||
#define N_TXTOFF(x) 2048
|
||||
|
||||
#define N_TXTSIZE(x) ((x).a_text)
|
||||
|
||||
#define N_DATADDR(x)
|
||||
|
||||
#define N_BSSADDR(x)
|
||||
|
||||
/* Offsets of the various portions of the file after the text segment. */
|
||||
|
||||
#define N_DATOFF(x) ( N_TXTOFF(x) + N_TXTSIZE(x) )
|
||||
#define N_TRELOFF(x) ( N_DATOFF(x) + (x).a_data )
|
||||
#define N_DRELOFF(x) ( N_TRELOFF(x) + (x).a_trsize )
|
||||
#define N_SYMOFF(x) ( N_DRELOFF(x) + (x).a_drsize )
|
||||
#define N_STROFF(x) ( N_SYMOFF(x) + (x).a_syms )
|
||||
|
||||
/* Symbols */
|
||||
struct external_nlist {
|
||||
bfd_byte e_strx[BYTES_IN_WORD]; /* index into string table of name */
|
||||
bfd_byte e_type[1]; /* type of symbol */
|
||||
bfd_byte e_other[1]; /* misc info (usually empty) */
|
||||
bfd_byte e_desc[2]; /* description field */
|
||||
bfd_byte e_value[BYTES_IN_WORD]; /* value of symbol */
|
||||
};
|
||||
|
||||
#define EXTERNAL_NLIST_SIZE (BYTES_IN_WORD+4+BYTES_IN_WORD)
|
||||
|
||||
struct internal_nlist {
|
||||
unsigned long n_strx; /* index into string table of name */
|
||||
unsigned char n_type; /* type of symbol */
|
||||
unsigned char n_other; /* misc info (usually empty) */
|
||||
unsigned short n_desc; /* description field */
|
||||
bfd_vma n_value; /* value of symbol */
|
||||
};
|
||||
|
||||
/* The n_type field is the symbol type, containing: */
|
||||
|
||||
#define N_UNDF 0 /* Undefined symbol */
|
||||
#define N_ABS 2 /* Absolute symbol -- defined at particular addr */
|
||||
#define N_TEXT 4 /* Text sym -- defined at offset in text seg */
|
||||
#define N_DATA 6 /* Data sym -- defined at offset in data seg */
|
||||
#define N_BSS 8 /* BSS sym -- defined at offset in zero'd seg */
|
||||
#define N_COMM 0x12 /* Common symbol (visible after shared lib dynlink) */
|
||||
#define N_FN 0x1f /* File name of .o file */
|
||||
#define N_FN_SEQ 0x0C /* N_FN from Sequent compilers (sigh) */
|
||||
/* Note: N_EXT can only be usefully OR-ed with N_UNDF, N_ABS, N_TEXT,
|
||||
N_DATA, or N_BSS. When the low-order bit of other types is set,
|
||||
(e.g. N_WARNING versus N_FN), they are two different types. */
|
||||
#define N_EXT 1 /* External symbol (as opposed to local-to-this-file) */
|
||||
#define N_TYPE 0x1e
|
||||
#define N_STAB 0xe0 /* If any of these bits are on, it's a debug symbol */
|
||||
|
||||
#define N_INDR 0x0a
|
||||
|
||||
/* The following symbols refer to set elements.
|
||||
All the N_SET[ATDB] symbols with the same name form one set.
|
||||
Space is allocated for the set in the text section, and each set
|
||||
elements value is stored into one word of the space.
|
||||
The first word of the space is the length of the set (number of elements).
|
||||
|
||||
The address of the set is made into an N_SETV symbol
|
||||
whose name is the same as the name of the set.
|
||||
This symbol acts like a N_DATA global symbol
|
||||
in that it can satisfy undefined external references. */
|
||||
|
||||
/* These appear as input to LD, in a .o file. */
|
||||
#define N_SETA 0x14 /* Absolute set element symbol */
|
||||
#define N_SETT 0x16 /* Text set element symbol */
|
||||
#define N_SETD 0x18 /* Data set element symbol */
|
||||
#define N_SETB 0x1A /* Bss set element symbol */
|
||||
|
||||
/* This is output from LD. */
|
||||
#define N_SETV 0x1C /* Pointer to set vector in data area. */
|
||||
|
||||
/* Warning symbol. The text gives a warning message, the next symbol
|
||||
in the table will be undefined. When the symbol is referenced, the
|
||||
message is printed. */
|
||||
|
||||
#define N_WARNING 0x1e
|
||||
|
||||
/* Relocations
|
||||
|
||||
There are two types of relocation flavours for a.out systems,
|
||||
standard and extended. The standard form is used on systems where the
|
||||
instruction has room for all the bits of an offset to the operand, whilst
|
||||
the extended form is used when an address operand has to be split over n
|
||||
instructions. Eg, on the 68k, each move instruction can reference
|
||||
the target with a displacement of 16 or 32 bits. On the sparc, move
|
||||
instructions use an offset of 14 bits, so the offset is stored in
|
||||
the reloc field, and the data in the section is ignored.
|
||||
*/
|
||||
|
||||
/* This structure describes a single relocation to be performed.
|
||||
The text-relocation section of the file is a vector of these structures,
|
||||
all of which apply to the text section.
|
||||
Likewise, the data-relocation section applies to the data section. */
|
||||
|
||||
struct reloc_std_external {
|
||||
bfd_byte r_address[BYTES_IN_WORD]; /* offset of of data to relocate */
|
||||
bfd_byte r_index[3]; /* symbol table index of symbol */
|
||||
bfd_byte r_type[1]; /* relocation type */
|
||||
};
|
||||
|
||||
#define RELOC_STD_BITS_PCREL_BIG 0x80
|
||||
#define RELOC_STD_BITS_PCREL_LITTLE 0x01
|
||||
|
||||
#define RELOC_STD_BITS_LENGTH_BIG 0x60
|
||||
#define RELOC_STD_BITS_LENGTH_SH_BIG 5 /* To shift to units place */
|
||||
#define RELOC_STD_BITS_LENGTH_LITTLE 0x06
|
||||
#define RELOC_STD_BITS_LENGTH_SH_LITTLE 1
|
||||
|
||||
#define RELOC_STD_BITS_EXTERN_BIG 0x10
|
||||
#define RELOC_STD_BITS_EXTERN_LITTLE 0x08
|
||||
|
||||
#define RELOC_STD_BITS_BASEREL_BIG 0x08
|
||||
#define RELOC_STD_BITS_BASEREL_LITTLE 0x08
|
||||
|
||||
#define RELOC_STD_BITS_JMPTABLE_BIG 0x04
|
||||
#define RELOC_STD_BITS_JMPTABLE_LITTLE 0x04
|
||||
|
||||
#define RELOC_STD_BITS_RELATIVE_BIG 0x02
|
||||
#define RELOC_STD_BITS_RELATIVE_LITTLE 0x02
|
||||
|
||||
#define RELOC_STD_SIZE (BYTES_IN_WORD + 3 + 1) /* Bytes per relocation entry */
|
||||
|
||||
struct reloc_std_internal
|
||||
{
|
||||
bfd_vma r_address; /* Address (within segment) to be relocated. */
|
||||
/* The meaning of r_symbolnum depends on r_extern. */
|
||||
unsigned int r_symbolnum:24;
|
||||
/* Nonzero means value is a pc-relative offset
|
||||
and it should be relocated for changes in its own address
|
||||
as well as for changes in the symbol or section specified. */
|
||||
unsigned int r_pcrel:1;
|
||||
/* Length (as exponent of 2) of the field to be relocated.
|
||||
Thus, a value of 2 indicates 1<<2 bytes. */
|
||||
unsigned int r_length:2;
|
||||
/* 1 => relocate with value of symbol.
|
||||
r_symbolnum is the index of the symbol
|
||||
in files the symbol table.
|
||||
0 => relocate with the address of a segment.
|
||||
r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS
|
||||
(the N_EXT bit may be set also, but signifies nothing). */
|
||||
unsigned int r_extern:1;
|
||||
/* The next three bits are for SunOS shared libraries, and seem to
|
||||
be undocumented. */
|
||||
unsigned int r_baserel:1; /* Linkage table relative */
|
||||
unsigned int r_jmptable:1; /* pc-relative to jump table */
|
||||
unsigned int r_relative:1; /* "relative relocation" */
|
||||
/* unused */
|
||||
unsigned int r_pad:1; /* Padding -- set to zero */
|
||||
};
|
||||
|
||||
|
||||
/* EXTENDED RELOCS */
|
||||
|
||||
struct reloc_ext_external {
|
||||
bfd_byte r_address[BYTES_IN_WORD]; /* offset of of data to relocate */
|
||||
bfd_byte r_index[3]; /* symbol table index of symbol */
|
||||
bfd_byte r_type[1]; /* relocation type */
|
||||
bfd_byte r_addend[BYTES_IN_WORD]; /* datum addend */
|
||||
};
|
||||
|
||||
#define RELOC_EXT_BITS_EXTERN_BIG 0x80
|
||||
#define RELOC_EXT_BITS_EXTERN_LITTLE 0x01
|
||||
|
||||
#define RELOC_EXT_BITS_TYPE_BIG 0x1F
|
||||
#define RELOC_EXT_BITS_TYPE_SH_BIG 0
|
||||
#define RELOC_EXT_BITS_TYPE_LITTLE 0xF8
|
||||
#define RELOC_EXT_BITS_TYPE_SH_LITTLE 3
|
||||
|
||||
/* Bytes per relocation entry */
|
||||
#define RELOC_EXT_SIZE (BYTES_IN_WORD + 3 + 1 + BYTES_IN_WORD)
|
||||
|
||||
enum reloc_type
|
||||
{
|
||||
/* simple relocations */
|
||||
RELOC_8, /* data[0:7] = addend + sv */
|
||||
RELOC_16, /* data[0:15] = addend + sv */
|
||||
RELOC_32, /* data[0:31] = addend + sv */
|
||||
/* pc-rel displacement */
|
||||
RELOC_DISP8, /* data[0:7] = addend - pc + sv */
|
||||
RELOC_DISP16, /* data[0:15] = addend - pc + sv */
|
||||
RELOC_DISP32, /* data[0:31] = addend - pc + sv */
|
||||
/* Special */
|
||||
RELOC_WDISP30, /* data[0:29] = (addend + sv - pc)>>2 */
|
||||
RELOC_WDISP22, /* data[0:21] = (addend + sv - pc)>>2 */
|
||||
RELOC_HI22, /* data[0:21] = (addend + sv)>>10 */
|
||||
RELOC_22, /* data[0:21] = (addend + sv) */
|
||||
RELOC_13, /* data[0:12] = (addend + sv) */
|
||||
RELOC_LO10, /* data[0:9] = (addend + sv) */
|
||||
RELOC_SFA_BASE,
|
||||
RELOC_SFA_OFF13,
|
||||
/* P.I.C. (base-relative) */
|
||||
RELOC_BASE10, /* Not sure - maybe we can do this the */
|
||||
RELOC_BASE13, /* right way now */
|
||||
RELOC_BASE22,
|
||||
/* for some sort of pc-rel P.I.C. (?) */
|
||||
RELOC_PC10,
|
||||
RELOC_PC22,
|
||||
/* P.I.C. jump table */
|
||||
RELOC_JMP_TBL,
|
||||
/* reputedly for shared libraries somehow */
|
||||
RELOC_SEGOFF16,
|
||||
RELOC_GLOB_DAT,
|
||||
RELOC_JMP_SLOT,
|
||||
RELOC_RELATIVE,
|
||||
|
||||
RELOC_11,
|
||||
RELOC_WDISP2_14,
|
||||
RELOC_WDISP19,
|
||||
RELOC_HHI22, /* data[0:21] = (addend + sv) >> 42 */
|
||||
RELOC_HLO10, /* data[0:9] = (addend + sv) >> 32 */
|
||||
|
||||
/* 29K relocation types */
|
||||
RELOC_JUMPTARG,
|
||||
RELOC_CONST,
|
||||
RELOC_CONSTH,
|
||||
|
||||
NO_RELOC
|
||||
};
|
||||
|
||||
|
||||
struct reloc_internal {
|
||||
bfd_vma r_address; /* offset of of data to relocate */
|
||||
long r_index; /* symbol table index of symbol */
|
||||
enum reloc_type r_type; /* relocation type */
|
||||
bfd_vma r_addend; /* datum addend */
|
||||
};
|
||||
|
||||
#endif /* __A_OUT_ADOBE_H__ */
|
|
@ -0,0 +1,516 @@
|
|||
/* `a.out' object-file definitions, including extensions to 64-bit fields
|
||||
|
||||
Copyright 1999, 2000, 2001, 2003, 2009, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#ifndef __A_OUT_64_H__
|
||||
#define __A_OUT_64_H__
|
||||
|
||||
#ifndef BYTES_IN_WORD
|
||||
#define BYTES_IN_WORD 4
|
||||
#endif
|
||||
|
||||
/* This is the layout on disk of the 32-bit or 64-bit exec header. */
|
||||
|
||||
#ifndef external_exec
|
||||
struct external_exec
|
||||
{
|
||||
bfd_byte e_info[4]; /* Magic number and stuff. */
|
||||
bfd_byte e_text[BYTES_IN_WORD]; /* Length of text section in bytes. */
|
||||
bfd_byte e_data[BYTES_IN_WORD]; /* Length of data section in bytes. */
|
||||
bfd_byte e_bss[BYTES_IN_WORD]; /* Length of bss area in bytes. */
|
||||
bfd_byte e_syms[BYTES_IN_WORD]; /* Length of symbol table in bytes. */
|
||||
bfd_byte e_entry[BYTES_IN_WORD]; /* Start address. */
|
||||
bfd_byte e_trsize[BYTES_IN_WORD]; /* Length of text relocation info. */
|
||||
bfd_byte e_drsize[BYTES_IN_WORD]; /* Length of data relocation info. */
|
||||
};
|
||||
|
||||
#define EXEC_BYTES_SIZE (4 + BYTES_IN_WORD * 7)
|
||||
|
||||
/* Magic numbers for a.out files. */
|
||||
|
||||
#if ARCH_SIZE==64
|
||||
#define OMAGIC 0x1001 /* Code indicating object file. */
|
||||
#define ZMAGIC 0x1002 /* Code indicating demand-paged executable. */
|
||||
#define NMAGIC 0x1003 /* Code indicating pure executable. */
|
||||
|
||||
/* There is no 64-bit QMAGIC as far as I know. */
|
||||
|
||||
#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
|
||||
&& N_MAGIC(x) != NMAGIC \
|
||||
&& N_MAGIC(x) != ZMAGIC)
|
||||
#else
|
||||
#define OMAGIC 0407 /* Object file or impure executable. */
|
||||
#define NMAGIC 0410 /* Code indicating pure executable. */
|
||||
#define ZMAGIC 0413 /* Code indicating demand-paged executable. */
|
||||
#define BMAGIC 0415 /* Used by a b.out object. */
|
||||
|
||||
/* This indicates a demand-paged executable with the header in the text.
|
||||
It is used by 386BSD (and variants) and Linux, at least. */
|
||||
#ifndef QMAGIC
|
||||
#define QMAGIC 0314
|
||||
#endif
|
||||
# ifndef N_BADMAG
|
||||
# define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
|
||||
&& N_MAGIC(x) != NMAGIC \
|
||||
&& N_MAGIC(x) != ZMAGIC \
|
||||
&& N_MAGIC(x) != QMAGIC)
|
||||
# endif /* N_BADMAG */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef QMAGIC
|
||||
#define N_IS_QMAGIC(x) (N_MAGIC (x) == QMAGIC)
|
||||
#else
|
||||
#define N_IS_QMAGIC(x) (0)
|
||||
#endif
|
||||
|
||||
/* The difference between TARGET_PAGE_SIZE and N_SEGSIZE is that TARGET_PAGE_SIZE is
|
||||
the finest granularity at which you can page something, thus it
|
||||
controls the padding (if any) before the text segment of a ZMAGIC
|
||||
file. N_SEGSIZE is the resolution at which things can be marked as
|
||||
read-only versus read/write, so it controls the padding between the
|
||||
text segment and the data segment (in memory; on disk the padding
|
||||
between them is TARGET_PAGE_SIZE). TARGET_PAGE_SIZE and N_SEGSIZE are the same
|
||||
for most machines, but different for sun3. */
|
||||
|
||||
/* By default, segment size is constant. But some machines override this
|
||||
to be a function of the a.out header (e.g. machine type). */
|
||||
|
||||
#ifndef N_SEGSIZE
|
||||
#define N_SEGSIZE(x) SEGMENT_SIZE
|
||||
#endif
|
||||
|
||||
/* Virtual memory address of the text section.
|
||||
This is getting very complicated. A good reason to discard a.out format
|
||||
for something that specifies these fields explicitly. But til then...
|
||||
|
||||
* OMAGIC and NMAGIC files:
|
||||
(object files: text for "relocatable addr 0" right after the header)
|
||||
start at 0, offset is EXEC_BYTES_SIZE, size as stated.
|
||||
* The text address, offset, and size of ZMAGIC files depend
|
||||
on the entry point of the file:
|
||||
* entry point below TEXT_START_ADDR:
|
||||
(hack for SunOS shared libraries)
|
||||
start at 0, offset is 0, size as stated.
|
||||
* If N_HEADER_IN_TEXT(x) is true (which defaults to being the
|
||||
case when the entry point is EXEC_BYTES_SIZE or further into a page):
|
||||
no padding is needed; text can start after exec header. Sun
|
||||
considers the text segment of such files to include the exec header;
|
||||
for BFD's purposes, we don't, which makes more work for us.
|
||||
start at TEXT_START_ADDR + EXEC_BYTES_SIZE, offset is EXEC_BYTES_SIZE,
|
||||
size as stated minus EXEC_BYTES_SIZE.
|
||||
* If N_HEADER_IN_TEXT(x) is false (which defaults to being the case when
|
||||
the entry point is less than EXEC_BYTES_SIZE into a page (e.g. page
|
||||
aligned)): (padding is needed so that text can start at a page boundary)
|
||||
start at TEXT_START_ADDR, offset TARGET_PAGE_SIZE, size as stated.
|
||||
|
||||
Specific configurations may want to hardwire N_HEADER_IN_TEXT,
|
||||
for efficiency or to allow people to play games with the entry point.
|
||||
In that case, you would #define N_HEADER_IN_TEXT(x) as 1 for sunos,
|
||||
and as 0 for most other hosts (Sony News, Vax Ultrix, etc).
|
||||
(Do this in the appropriate bfd target file.)
|
||||
(The default is a heuristic that will break if people try changing
|
||||
the entry point, perhaps with the ld -e flag.)
|
||||
|
||||
* QMAGIC is always like a ZMAGIC for which N_HEADER_IN_TEXT is true,
|
||||
and for which the starting address is TARGET_PAGE_SIZE (or should this be
|
||||
SEGMENT_SIZE?) (TEXT_START_ADDR only applies to ZMAGIC, not to QMAGIC). */
|
||||
|
||||
/* This macro is only relevant for ZMAGIC files; QMAGIC always has the header
|
||||
in the text. */
|
||||
#ifndef N_HEADER_IN_TEXT
|
||||
#define N_HEADER_IN_TEXT(x) \
|
||||
(((x).a_entry & (TARGET_PAGE_SIZE-1)) >= EXEC_BYTES_SIZE)
|
||||
#endif
|
||||
|
||||
/* Sun shared libraries, not linux. This macro is only relevant for ZMAGIC
|
||||
files. */
|
||||
#ifndef N_SHARED_LIB
|
||||
#define N_SHARED_LIB(x) (0)
|
||||
#endif
|
||||
|
||||
/* Returning 0 not TEXT_START_ADDR for OMAGIC and NMAGIC is based on
|
||||
the assumption that we are dealing with a .o file, not an
|
||||
executable. This is necessary for OMAGIC (but means we don't work
|
||||
right on the output from ld -N); more questionable for NMAGIC. */
|
||||
|
||||
#ifndef N_TXTADDR
|
||||
#define N_TXTADDR(x) \
|
||||
(/* The address of a QMAGIC file is always one page in, \
|
||||
with the header in the text. */ \
|
||||
N_IS_QMAGIC (x) \
|
||||
? (bfd_vma) TARGET_PAGE_SIZE + EXEC_BYTES_SIZE \
|
||||
: (N_MAGIC (x) != ZMAGIC \
|
||||
? (bfd_vma) 0 /* Object file or NMAGIC. */ \
|
||||
: (N_SHARED_LIB (x) \
|
||||
? (bfd_vma) 0 \
|
||||
: (N_HEADER_IN_TEXT (x) \
|
||||
? (bfd_vma) TEXT_START_ADDR + EXEC_BYTES_SIZE \
|
||||
: (bfd_vma) TEXT_START_ADDR))))
|
||||
#endif
|
||||
|
||||
/* If N_HEADER_IN_TEXT is not true for ZMAGIC, there is some padding
|
||||
to make the text segment start at a certain boundary. For most
|
||||
systems, this boundary is TARGET_PAGE_SIZE. But for Linux, in the
|
||||
time-honored tradition of crazy ZMAGIC hacks, it is 1024 which is
|
||||
not what TARGET_PAGE_SIZE needs to be for QMAGIC. */
|
||||
|
||||
#ifndef ZMAGIC_DISK_BLOCK_SIZE
|
||||
#define ZMAGIC_DISK_BLOCK_SIZE TARGET_PAGE_SIZE
|
||||
#endif
|
||||
|
||||
#define N_DISK_BLOCK_SIZE(x) \
|
||||
(N_MAGIC(x) == ZMAGIC ? ZMAGIC_DISK_BLOCK_SIZE : TARGET_PAGE_SIZE)
|
||||
|
||||
/* Offset in an a.out of the start of the text section. */
|
||||
#ifndef N_TXTOFF
|
||||
#define N_TXTOFF(x) \
|
||||
(/* For {O,N,Q}MAGIC, no padding. */ \
|
||||
N_MAGIC (x) != ZMAGIC \
|
||||
? EXEC_BYTES_SIZE \
|
||||
: (N_SHARED_LIB (x) \
|
||||
? 0 \
|
||||
: (N_HEADER_IN_TEXT (x) \
|
||||
? EXEC_BYTES_SIZE /* No padding. */ \
|
||||
: ZMAGIC_DISK_BLOCK_SIZE /* A page of padding. */)))
|
||||
#endif
|
||||
/* Size of the text section. It's always as stated, except that we
|
||||
offset it to `undo' the adjustment to N_TXTADDR and N_TXTOFF
|
||||
for ZMAGIC files that nominally include the exec header
|
||||
as part of the first page of text. (BFD doesn't consider the
|
||||
exec header to be part of the text segment.) */
|
||||
#ifndef N_TXTSIZE
|
||||
#define N_TXTSIZE(x) \
|
||||
(/* For QMAGIC, we don't consider the header part of the text section. */\
|
||||
N_IS_QMAGIC (x) \
|
||||
? (x).a_text - EXEC_BYTES_SIZE \
|
||||
: ((N_MAGIC (x) != ZMAGIC || N_SHARED_LIB (x)) \
|
||||
? (x).a_text \
|
||||
: (N_HEADER_IN_TEXT (x) \
|
||||
? (x).a_text - EXEC_BYTES_SIZE /* No padding. */ \
|
||||
: (x).a_text /* A page of padding. */ )))
|
||||
#endif
|
||||
/* The address of the data segment in virtual memory.
|
||||
It is the text segment address, plus text segment size, rounded
|
||||
up to a N_SEGSIZE boundary for pure or pageable files. */
|
||||
#ifndef N_DATADDR
|
||||
#define N_DATADDR(x) \
|
||||
(N_MAGIC (x) == OMAGIC \
|
||||
? (N_TXTADDR (x) + N_TXTSIZE (x)) \
|
||||
: (N_SEGSIZE (x) + ((N_TXTADDR (x) + N_TXTSIZE (x) - 1) \
|
||||
& ~ (bfd_vma) (N_SEGSIZE (x) - 1))))
|
||||
#endif
|
||||
/* The address of the BSS segment -- immediately after the data segment. */
|
||||
|
||||
#define N_BSSADDR(x) (N_DATADDR (x) + (x).a_data)
|
||||
|
||||
/* Offsets of the various portions of the file after the text segment. */
|
||||
|
||||
/* For {Q,Z}MAGIC, there is padding to make the data segment start on
|
||||
a page boundary. Most of the time the a_text field (and thus
|
||||
N_TXTSIZE) already contains this padding. It is possible that for
|
||||
BSDI and/or 386BSD it sometimes doesn't contain the padding, and
|
||||
perhaps we should be adding it here. But this seems kind of
|
||||
questionable and probably should be BSDI/386BSD-specific if we do
|
||||
do it.
|
||||
|
||||
For NMAGIC (at least for hp300 BSD, probably others), there is
|
||||
padding in memory only, not on disk, so we must *not* ever pad here
|
||||
for NMAGIC. */
|
||||
|
||||
#ifndef N_DATOFF
|
||||
#define N_DATOFF(x) (N_TXTOFF (x) + N_TXTSIZE (x))
|
||||
#endif
|
||||
#ifndef N_TRELOFF
|
||||
#define N_TRELOFF(x) (N_DATOFF (x) + (x).a_data)
|
||||
#endif
|
||||
#ifndef N_DRELOFF
|
||||
#define N_DRELOFF(x) (N_TRELOFF (x) + (x).a_trsize)
|
||||
#endif
|
||||
#ifndef N_SYMOFF
|
||||
#define N_SYMOFF(x) (N_DRELOFF (x) + (x).a_drsize)
|
||||
#endif
|
||||
#ifndef N_STROFF
|
||||
#define N_STROFF(x) (N_SYMOFF (x) + (x).a_syms)
|
||||
#endif
|
||||
|
||||
/* Symbols */
|
||||
#ifndef external_nlist
|
||||
struct external_nlist
|
||||
{
|
||||
bfd_byte e_strx[BYTES_IN_WORD]; /* Index into string table of name. */
|
||||
bfd_byte e_type[1]; /* Type of symbol. */
|
||||
bfd_byte e_other[1]; /* Misc info (usually empty). */
|
||||
bfd_byte e_desc[2]; /* Description field. */
|
||||
bfd_byte e_value[BYTES_IN_WORD]; /* Value of symbol. */
|
||||
};
|
||||
#define EXTERNAL_NLIST_SIZE (BYTES_IN_WORD+4+BYTES_IN_WORD)
|
||||
#endif
|
||||
|
||||
struct internal_nlist
|
||||
{
|
||||
unsigned long n_strx; /* Index into string table of name. */
|
||||
unsigned char n_type; /* Type of symbol. */
|
||||
unsigned char n_other; /* Misc info (usually empty). */
|
||||
unsigned short n_desc; /* Description field. */
|
||||
bfd_vma n_value; /* Value of symbol. */
|
||||
};
|
||||
|
||||
/* The n_type field is the symbol type, containing: */
|
||||
|
||||
#define N_UNDF 0 /* Undefined symbol. */
|
||||
#define N_ABS 2 /* Absolute symbol -- defined at particular addr. */
|
||||
#define N_TEXT 4 /* Text sym -- defined at offset in text seg. */
|
||||
#define N_DATA 6 /* Data sym -- defined at offset in data seg. */
|
||||
#define N_BSS 8 /* BSS sym -- defined at offset in zero'd seg. */
|
||||
#define N_COMM 0x12 /* Common symbol (visible after shared lib dynlink). */
|
||||
#define N_FN 0x1f /* File name of .o file. */
|
||||
#define N_FN_SEQ 0x0C /* N_FN from Sequent compilers (sigh). */
|
||||
/* Note: N_EXT can only be usefully OR-ed with N_UNDF, N_ABS, N_TEXT,
|
||||
N_DATA, or N_BSS. When the low-order bit of other types is set,
|
||||
(e.g. N_WARNING versus N_FN), they are two different types. */
|
||||
#define N_EXT 1 /* External symbol (as opposed to local-to-this-file). */
|
||||
#define N_TYPE 0x1e
|
||||
#define N_STAB 0xe0 /* If any of these bits are on, it's a debug symbol. */
|
||||
|
||||
#define N_INDR 0x0a
|
||||
|
||||
/* The following symbols refer to set elements.
|
||||
All the N_SET[ATDB] symbols with the same name form one set.
|
||||
Space is allocated for the set in the text section, and each set
|
||||
elements value is stored into one word of the space.
|
||||
The first word of the space is the length of the set (number of elements).
|
||||
|
||||
The address of the set is made into an N_SETV symbol
|
||||
whose name is the same as the name of the set.
|
||||
This symbol acts like a N_DATA global symbol
|
||||
in that it can satisfy undefined external references. */
|
||||
|
||||
/* These appear as input to LD, in a .o file. */
|
||||
#define N_SETA 0x14 /* Absolute set element symbol. */
|
||||
#define N_SETT 0x16 /* Text set element symbol. */
|
||||
#define N_SETD 0x18 /* Data set element symbol. */
|
||||
#define N_SETB 0x1A /* Bss set element symbol. */
|
||||
|
||||
/* This is output from LD. */
|
||||
#define N_SETV 0x1C /* Pointer to set vector in data area. */
|
||||
|
||||
/* Warning symbol. The text gives a warning message, the next symbol
|
||||
in the table will be undefined. When the symbol is referenced, the
|
||||
message is printed. */
|
||||
|
||||
#define N_WARNING 0x1e
|
||||
|
||||
/* Weak symbols. These are a GNU extension to the a.out format. The
|
||||
semantics are those of ELF weak symbols. Weak symbols are always
|
||||
externally visible. The N_WEAK? values are squeezed into the
|
||||
available slots. The value of a N_WEAKU symbol is 0. The values
|
||||
of the other types are the definitions. */
|
||||
#define N_WEAKU 0x0d /* Weak undefined symbol. */
|
||||
#define N_WEAKA 0x0e /* Weak absolute symbol. */
|
||||
#define N_WEAKT 0x0f /* Weak text symbol. */
|
||||
#define N_WEAKD 0x10 /* Weak data symbol. */
|
||||
#define N_WEAKB 0x11 /* Weak bss symbol. */
|
||||
|
||||
/* Relocations
|
||||
|
||||
There are two types of relocation flavours for a.out systems,
|
||||
standard and extended. The standard form is used on systems where the
|
||||
instruction has room for all the bits of an offset to the operand, whilst
|
||||
the extended form is used when an address operand has to be split over n
|
||||
instructions. Eg, on the 68k, each move instruction can reference
|
||||
the target with a displacement of 16 or 32 bits. On the sparc, move
|
||||
instructions use an offset of 14 bits, so the offset is stored in
|
||||
the reloc field, and the data in the section is ignored. */
|
||||
|
||||
/* This structure describes a single relocation to be performed.
|
||||
The text-relocation section of the file is a vector of these structures,
|
||||
all of which apply to the text section.
|
||||
Likewise, the data-relocation section applies to the data section. */
|
||||
|
||||
struct reloc_std_external
|
||||
{
|
||||
bfd_byte r_address[BYTES_IN_WORD]; /* Offset of of data to relocate. */
|
||||
bfd_byte r_index[3]; /* Symbol table index of symbol. */
|
||||
bfd_byte r_type[1]; /* Relocation type. */
|
||||
};
|
||||
|
||||
#define RELOC_STD_BITS_PCREL_BIG ((unsigned int) 0x80)
|
||||
#define RELOC_STD_BITS_PCREL_LITTLE ((unsigned int) 0x01)
|
||||
|
||||
#define RELOC_STD_BITS_LENGTH_BIG ((unsigned int) 0x60)
|
||||
#define RELOC_STD_BITS_LENGTH_SH_BIG 5
|
||||
#define RELOC_STD_BITS_LENGTH_LITTLE ((unsigned int) 0x06)
|
||||
#define RELOC_STD_BITS_LENGTH_SH_LITTLE 1
|
||||
|
||||
#define RELOC_STD_BITS_EXTERN_BIG ((unsigned int) 0x10)
|
||||
#define RELOC_STD_BITS_EXTERN_LITTLE ((unsigned int) 0x08)
|
||||
|
||||
#define RELOC_STD_BITS_BASEREL_BIG ((unsigned int) 0x08)
|
||||
#define RELOC_STD_BITS_BASEREL_LITTLE ((unsigned int) 0x10)
|
||||
|
||||
#define RELOC_STD_BITS_JMPTABLE_BIG ((unsigned int) 0x04)
|
||||
#define RELOC_STD_BITS_JMPTABLE_LITTLE ((unsigned int) 0x20)
|
||||
|
||||
#define RELOC_STD_BITS_RELATIVE_BIG ((unsigned int) 0x02)
|
||||
#define RELOC_STD_BITS_RELATIVE_LITTLE ((unsigned int) 0x40)
|
||||
|
||||
#define RELOC_STD_SIZE (BYTES_IN_WORD + 3 + 1) /* Bytes per relocation entry. */
|
||||
|
||||
struct reloc_std_internal
|
||||
{
|
||||
bfd_vma r_address; /* Address (within segment) to be relocated. */
|
||||
/* The meaning of r_symbolnum depends on r_extern. */
|
||||
unsigned int r_symbolnum:24;
|
||||
/* Nonzero means value is a pc-relative offset
|
||||
and it should be relocated for changes in its own address
|
||||
as well as for changes in the symbol or section specified. */
|
||||
unsigned int r_pcrel:1;
|
||||
/* Length (as exponent of 2) of the field to be relocated.
|
||||
Thus, a value of 2 indicates 1<<2 bytes. */
|
||||
unsigned int r_length:2;
|
||||
/* 1 => relocate with value of symbol.
|
||||
r_symbolnum is the index of the symbol
|
||||
in files the symbol table.
|
||||
0 => relocate with the address of a segment.
|
||||
r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS
|
||||
(the N_EXT bit may be set also, but signifies nothing). */
|
||||
unsigned int r_extern:1;
|
||||
/* The next three bits are for SunOS shared libraries, and seem to
|
||||
be undocumented. */
|
||||
unsigned int r_baserel:1; /* Linkage table relative. */
|
||||
unsigned int r_jmptable:1; /* pc-relative to jump table. */
|
||||
unsigned int r_relative:1; /* "relative relocation". */
|
||||
/* unused */
|
||||
unsigned int r_pad:1; /* Padding -- set to zero. */
|
||||
};
|
||||
|
||||
|
||||
/* EXTENDED RELOCS. */
|
||||
|
||||
struct reloc_ext_external
|
||||
{
|
||||
bfd_byte r_address[BYTES_IN_WORD]; /* Offset of of data to relocate. */
|
||||
bfd_byte r_index[3]; /* Symbol table index of symbol. */
|
||||
bfd_byte r_type[1]; /* Relocation type. */
|
||||
bfd_byte r_addend[BYTES_IN_WORD]; /* Datum addend. */
|
||||
};
|
||||
|
||||
#ifndef RELOC_EXT_BITS_EXTERN_BIG
|
||||
#define RELOC_EXT_BITS_EXTERN_BIG ((unsigned int) 0x80)
|
||||
#endif
|
||||
|
||||
#ifndef RELOC_EXT_BITS_EXTERN_LITTLE
|
||||
#define RELOC_EXT_BITS_EXTERN_LITTLE ((unsigned int) 0x01)
|
||||
#endif
|
||||
|
||||
#ifndef RELOC_EXT_BITS_TYPE_BIG
|
||||
#define RELOC_EXT_BITS_TYPE_BIG ((unsigned int) 0x1F)
|
||||
#endif
|
||||
|
||||
#ifndef RELOC_EXT_BITS_TYPE_SH_BIG
|
||||
#define RELOC_EXT_BITS_TYPE_SH_BIG 0
|
||||
#endif
|
||||
|
||||
#ifndef RELOC_EXT_BITS_TYPE_LITTLE
|
||||
#define RELOC_EXT_BITS_TYPE_LITTLE ((unsigned int) 0xF8)
|
||||
#endif
|
||||
|
||||
#ifndef RELOC_EXT_BITS_TYPE_SH_LITTLE
|
||||
#define RELOC_EXT_BITS_TYPE_SH_LITTLE 3
|
||||
#endif
|
||||
|
||||
/* Bytes per relocation entry. */
|
||||
#define RELOC_EXT_SIZE (BYTES_IN_WORD + 3 + 1 + BYTES_IN_WORD)
|
||||
|
||||
enum reloc_type
|
||||
{
|
||||
/* Simple relocations. */
|
||||
RELOC_8, /* data[0:7] = addend + sv */
|
||||
RELOC_16, /* data[0:15] = addend + sv */
|
||||
RELOC_32, /* data[0:31] = addend + sv */
|
||||
/* PC-rel displacement. */
|
||||
RELOC_DISP8, /* data[0:7] = addend - pc + sv */
|
||||
RELOC_DISP16, /* data[0:15] = addend - pc + sv */
|
||||
RELOC_DISP32, /* data[0:31] = addend - pc + sv */
|
||||
/* Special. */
|
||||
RELOC_WDISP30, /* data[0:29] = (addend + sv - pc)>>2 */
|
||||
RELOC_WDISP22, /* data[0:21] = (addend + sv - pc)>>2 */
|
||||
RELOC_HI22, /* data[0:21] = (addend + sv)>>10 */
|
||||
RELOC_22, /* data[0:21] = (addend + sv) */
|
||||
RELOC_13, /* data[0:12] = (addend + sv) */
|
||||
RELOC_LO10, /* data[0:9] = (addend + sv) */
|
||||
RELOC_SFA_BASE,
|
||||
RELOC_SFA_OFF13,
|
||||
/* P.I.C. (base-relative). */
|
||||
RELOC_BASE10, /* Not sure - maybe we can do this the */
|
||||
RELOC_BASE13, /* right way now */
|
||||
RELOC_BASE22,
|
||||
/* For some sort of pc-rel P.I.C. (?) */
|
||||
RELOC_PC10,
|
||||
RELOC_PC22,
|
||||
/* P.I.C. jump table. */
|
||||
RELOC_JMP_TBL,
|
||||
/* Reputedly for shared libraries somehow. */
|
||||
RELOC_SEGOFF16,
|
||||
RELOC_GLOB_DAT,
|
||||
RELOC_JMP_SLOT,
|
||||
RELOC_RELATIVE,
|
||||
|
||||
RELOC_11,
|
||||
RELOC_WDISP2_14,
|
||||
RELOC_WDISP19,
|
||||
RELOC_HHI22, /* data[0:21] = (addend + sv) >> 42 */
|
||||
RELOC_HLO10, /* data[0:9] = (addend + sv) >> 32 */
|
||||
|
||||
/* 29K relocation types. */
|
||||
RELOC_JUMPTARG,
|
||||
RELOC_CONST,
|
||||
RELOC_CONSTH,
|
||||
|
||||
/* All the new ones I can think of, for sparc v9. */
|
||||
RELOC_64, /* data[0:63] = addend + sv */
|
||||
RELOC_DISP64, /* data[0:63] = addend - pc + sv */
|
||||
RELOC_WDISP21, /* data[0:20] = (addend + sv - pc)>>2 */
|
||||
RELOC_DISP21, /* data[0:20] = addend - pc + sv */
|
||||
RELOC_DISP14, /* data[0:13] = addend - pc + sv */
|
||||
/* Q .
|
||||
What are the other ones,
|
||||
Since this is a clean slate, can we throw away the ones we dont
|
||||
understand ? Should we sort the values ? What about using a
|
||||
microcode format like the 68k ? */
|
||||
NO_RELOC
|
||||
};
|
||||
|
||||
|
||||
struct reloc_internal
|
||||
{
|
||||
bfd_vma r_address; /* Offset of of data to relocate. */
|
||||
long r_index; /* Symbol table index of symbol. */
|
||||
enum reloc_type r_type; /* Relocation type. */
|
||||
bfd_vma r_addend; /* Datum addend. */
|
||||
};
|
||||
|
||||
/* Q.
|
||||
Should the length of the string table be 4 bytes or 8 bytes ?
|
||||
|
||||
Q.
|
||||
What about archive indexes ? */
|
||||
|
||||
#endif /* __A_OUT_64_H__ */
|
|
@ -0,0 +1,55 @@
|
|||
/* archive file definition for GNU software
|
||||
|
||||
Copyright 2001, 2008, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* So far this is correct for BSDish archives. Don't forget that
|
||||
files must begin on an even byte boundary. */
|
||||
|
||||
#ifndef __GNU_AR_H__
|
||||
#define __GNU_AR_H__
|
||||
|
||||
/* Note that the usual '\n' in magic strings may translate to different
|
||||
characters, as allowed by ANSI. '\012' has a fixed value, and remains
|
||||
compatible with existing BSDish archives. */
|
||||
|
||||
#define ARMAG "!<arch>\012" /* For COFF and a.out archives. */
|
||||
#define ARMAGB "!<bout>\012" /* For b.out archives. */
|
||||
#define ARMAGT "!<thin>\012" /* For thin archives. */
|
||||
#define SARMAG 8
|
||||
#define ARFMAG "`\012"
|
||||
|
||||
/* The ar_date field of the armap (__.SYMDEF) member of an archive
|
||||
must be greater than the modified date of the entire file, or
|
||||
BSD-derived linkers complain. We originally write the ar_date with
|
||||
this offset from the real file's mod-time. After finishing the
|
||||
file, we rewrite ar_date if it's not still greater than the mod date. */
|
||||
|
||||
#define ARMAP_TIME_OFFSET 60
|
||||
|
||||
struct ar_hdr
|
||||
{
|
||||
char ar_name[16]; /* Name of this member. */
|
||||
char ar_date[12]; /* File mtime. */
|
||||
char ar_uid[6]; /* Owner uid; printed as decimal. */
|
||||
char ar_gid[6]; /* Owner gid; printed as decimal. */
|
||||
char ar_mode[8]; /* File mode, printed as octal. */
|
||||
char ar_size[10]; /* File size, printed as decimal. */
|
||||
char ar_fmag[2]; /* Should contain ARFMAG. */
|
||||
};
|
||||
|
||||
#endif /* __GNU_AR_H__ */
|
|
@ -0,0 +1,87 @@
|
|||
/* a.out specifics for Sequent Symmetry running Dynix 3.x
|
||||
|
||||
Copyright 2001, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#ifndef A_OUT_DYNIX3_H
|
||||
#define A_OUT_DYNIX3_H
|
||||
|
||||
#define external_exec dynix_external_exec
|
||||
|
||||
/* struct exec for Dynix 3
|
||||
|
||||
a_gdtbl and a_bootstrap are only for standalone binaries.
|
||||
Shared data fields are not supported by the kernel as of Dynix 3.1,
|
||||
but are supported by Dynix compiler programs. */
|
||||
struct dynix_external_exec
|
||||
{
|
||||
unsigned char e_info[4];
|
||||
unsigned char e_text[4];
|
||||
unsigned char e_data[4];
|
||||
unsigned char e_bss[4];
|
||||
unsigned char e_syms[4];
|
||||
unsigned char e_entry[4];
|
||||
unsigned char e_trsize[4];
|
||||
unsigned char e_drsize[4];
|
||||
unsigned char e_g_code[8];
|
||||
unsigned char e_g_data[8];
|
||||
unsigned char e_g_desc[8];
|
||||
unsigned char e_shdata[4];
|
||||
unsigned char e_shbss[4];
|
||||
unsigned char e_shdrsize[4];
|
||||
unsigned char e_bootstrap[44];
|
||||
unsigned char e_reserved[12];
|
||||
unsigned char e_version[4];
|
||||
};
|
||||
|
||||
#define EXEC_BYTES_SIZE (128)
|
||||
|
||||
/* All executables under Dynix are demand paged with read-only text,
|
||||
Thus no NMAGIC.
|
||||
|
||||
ZMAGIC has a page of 0s at virtual 0,
|
||||
XMAGIC has an invalid page at virtual 0. */
|
||||
#define OMAGIC 0x12eb /* .o */
|
||||
#define ZMAGIC 0x22eb /* zero @ 0, demand load */
|
||||
#define XMAGIC 0x32eb /* invalid @ 0, demand load */
|
||||
#define SMAGIC 0x42eb /* standalone, not supported here */
|
||||
|
||||
#define N_BADMAG(x) ((OMAGIC != N_MAGIC(x)) && \
|
||||
(ZMAGIC != N_MAGIC(x)) && \
|
||||
(XMAGIC != N_MAGIC(x)) && \
|
||||
(SMAGIC != N_MAGIC(x)))
|
||||
|
||||
#define N_ADDRADJ(x) ((ZMAGIC == N_MAGIC(x) || XMAGIC == N_MAGIC(x)) ? 0x1000 : 0)
|
||||
|
||||
#define N_TXTOFF(x) (EXEC_BYTES_SIZE)
|
||||
#define N_DATOFF(x) (N_TXTOFF(x) + N_TXTSIZE(x))
|
||||
#define N_SHDATOFF(x) (N_DATOFF(x) + (x).a_data)
|
||||
#define N_TRELOFF(x) (N_SHDATOFF(x) + (x).a_shdata)
|
||||
#define N_DRELOFF(x) (N_TRELOFF(x) + (x).a_trsize)
|
||||
#define N_SHDRELOFF(x) (N_DRELOFF(x) + (x).a_drsize)
|
||||
#define N_SYMOFF(x) (N_SHDRELOFF(x) + (x).a_shdrsize)
|
||||
#define N_STROFF(x) (N_SYMOFF(x) + (x).a_syms)
|
||||
|
||||
#define N_TXTADDR(x) \
|
||||
(((OMAGIC == N_MAGIC(x)) || (SMAGIC == N_MAGIC(x))) ? 0 \
|
||||
: TEXT_START_ADDR + EXEC_BYTES_SIZE)
|
||||
|
||||
#define N_TXTSIZE(x) \
|
||||
(((OMAGIC == N_MAGIC(x)) || (SMAGIC == N_MAGIC(x))) ? ((x).a_text) \
|
||||
: ((x).a_text - N_ADDRADJ(x) - EXEC_BYTES_SIZE))
|
||||
|
||||
#endif /* A_OUT_DYNIX3_H */
|
|
@ -0,0 +1,135 @@
|
|||
/* Yet Another Try at encapsulating bfd object files in coff.
|
||||
Copyright 1988, 1989, 1991, 2010 Free Software Foundation, Inc.
|
||||
Written by Pace Willisson 12/9/88
|
||||
|
||||
This file is obsolete. It needs to be converted to just define a bunch
|
||||
of stuff that BFD can use to do coff-encapsulated files. --gnu@cygnus.com
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/*
|
||||
* We only use the coff headers to tell the kernel
|
||||
* how to exec the file. Therefore, the only fields that need to
|
||||
* be filled in are the scnptr and vaddr for the text and data
|
||||
* sections, and the vaddr for the bss. As far as coff is concerned,
|
||||
* there is no symbol table, relocation, or line numbers.
|
||||
*
|
||||
* A normal bsd header (struct exec) is placed after the coff headers,
|
||||
* and before the real text. I defined a the new fields 'a_machtype'
|
||||
* and a_flags. If a_machtype is M_386, and a_flags & A_ENCAP is
|
||||
* true, then the bsd header is preceeded by a coff header. Macros
|
||||
* like N_TXTOFF and N_TXTADDR use this field to find the bsd header.
|
||||
*
|
||||
* The only problem is to track down the bsd exec header. The
|
||||
* macros HEADER_OFFSET, etc do this.
|
||||
*/
|
||||
|
||||
#define N_FLAGS_COFF_ENCAPSULATE 0x20 /* coff header precedes bsd header */
|
||||
|
||||
/* Describe the COFF header used for encapsulation. */
|
||||
|
||||
struct coffheader
|
||||
{
|
||||
/* filehdr */
|
||||
unsigned short f_magic;
|
||||
unsigned short f_nscns;
|
||||
long f_timdat;
|
||||
long f_symptr;
|
||||
long f_nsyms;
|
||||
unsigned short f_opthdr;
|
||||
unsigned short f_flags;
|
||||
/* aouthdr */
|
||||
short magic;
|
||||
short vstamp;
|
||||
long tsize;
|
||||
long dsize;
|
||||
long bsize;
|
||||
long entry;
|
||||
long text_start;
|
||||
long data_start;
|
||||
struct coffscn
|
||||
{
|
||||
char s_name[8];
|
||||
long s_paddr;
|
||||
long s_vaddr;
|
||||
long s_size;
|
||||
long s_scnptr;
|
||||
long s_relptr;
|
||||
long s_lnnoptr;
|
||||
unsigned short s_nreloc;
|
||||
unsigned short s_nlnno;
|
||||
long s_flags;
|
||||
} scns[3];
|
||||
};
|
||||
|
||||
/* Describe some of the parameters of the encapsulation,
|
||||
including how to find the encapsulated BSD header. */
|
||||
|
||||
/* FIXME, this is dumb. The same tools can't handle a.outs for different
|
||||
architectures, just because COFF_MAGIC is different; so you need a
|
||||
separate GNU nm for every architecture!!? Unfortunately, it needs to
|
||||
be this way, since the COFF_MAGIC value is determined by the kernel
|
||||
we're trying to fool here. */
|
||||
|
||||
#define COFF_MAGIC_I386 0514 /* I386MAGIC */
|
||||
#define COFF_MAGIC_M68K 0520 /* MC68MAGIC */
|
||||
|
||||
#ifdef COFF_MAGIC
|
||||
short __header_offset_temp;
|
||||
#define HEADER_OFFSET(f) \
|
||||
(__header_offset_temp = 0, \
|
||||
fread ((char *)&__header_offset_temp, sizeof (short), 1, (f)), \
|
||||
fseek ((f), -sizeof (short), 1), \
|
||||
__header_offset_temp==COFF_MAGIC ? sizeof(struct coffheader) : 0)
|
||||
#else
|
||||
#define HEADER_OFFSET(f) 0
|
||||
#endif
|
||||
|
||||
#define HEADER_SEEK(f) (fseek ((f), HEADER_OFFSET((f)), 1))
|
||||
|
||||
/* Describe the characteristics of the BSD header
|
||||
that appears inside the encapsulation. */
|
||||
|
||||
/* Encapsulated coff files that are linked ZMAGIC have a text segment
|
||||
offset just past the header (and a matching TXTADDR), excluding
|
||||
the headers from the text segment proper but keeping the physical
|
||||
layout and the virtual memory layout page-aligned.
|
||||
|
||||
Non-encapsulated a.out files that are linked ZMAGIC have a text
|
||||
segment that starts at 0 and an N_TXTADR similarly offset to 0.
|
||||
They too are page-aligned with each other, but they include the
|
||||
a.out header as part of the text.
|
||||
|
||||
The _N_HDROFF gets sizeof struct exec added to it, so we have
|
||||
to compensate here. See <a.out.gnu.h>. */
|
||||
|
||||
#undef _N_HDROFF
|
||||
#undef N_TXTADDR
|
||||
#undef N_DATADDR
|
||||
|
||||
#define _N_HDROFF(x) ((N_FLAGS(x) & N_FLAGS_COFF_ENCAPSULATE) ? \
|
||||
sizeof (struct coffheader) : 0)
|
||||
|
||||
/* Address of text segment in memory after it is loaded. */
|
||||
#define N_TXTADDR(x) \
|
||||
((N_FLAGS(x) & N_FLAGS_COFF_ENCAPSULATE) ? \
|
||||
sizeof (struct coffheader) + sizeof (struct exec) : 0)
|
||||
#define SEGMENT_SIZE 0x400000
|
||||
|
||||
#define N_DATADDR(x) \
|
||||
((N_FLAGS(x) & N_FLAGS_COFF_ENCAPSULATE) ? \
|
||||
(SEGMENT_SIZE + ((N_TXTADDR(x)+(x).a_text-1) & ~(SEGMENT_SIZE-1))) : \
|
||||
(N_TXTADDR(x)+(x).a_text))
|
|
@ -0,0 +1,43 @@
|
|||
/* host.h - Parameters about the a.out format, based on the host system
|
||||
on which the program is compiled.
|
||||
|
||||
Copyright 2001, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Address of data segment in memory after it is loaded.
|
||||
It is up to you to define SEGMENT_SIZE on machines not listed here. */
|
||||
#ifndef SEGMENT_SIZE
|
||||
|
||||
#if defined(hp300) || defined(pyr)
|
||||
#define SEGMENT_SIZE page_size
|
||||
#endif
|
||||
|
||||
#ifdef sony
|
||||
#define SEGMENT_SIZE 0x1000
|
||||
#endif /* Sony. */
|
||||
|
||||
#ifdef is68k
|
||||
#define SEGMENT_SIZE 0x20000
|
||||
#endif
|
||||
|
||||
#if defined(m68k) && defined(PORTAR)
|
||||
#define TARGET_PAGE_SIZE 0x400
|
||||
#define SEGMENT_SIZE TARGET_PAGE_SIZE
|
||||
#endif
|
||||
|
||||
#endif /*!defined(SEGMENT_SIZE)*/
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
/* Special version of <a.out.h> for use under HP-UX.
|
||||
Copyright 1988, 1991, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* THIS FILE IS OBSOLETE. It needs to be revised as a variant "external"
|
||||
a.out format for use with BFD. */
|
||||
|
||||
/* The `exec' structure and overall layout must be close to HP's when
|
||||
we are running on an HP system, otherwise we will not be able to
|
||||
execute the resulting file. */
|
||||
|
||||
/* Allow this file to be included twice. */
|
||||
#ifndef __GNU_EXEC_MACROS__
|
||||
|
||||
struct exec
|
||||
{
|
||||
unsigned short a_machtype; /* machine type */
|
||||
unsigned short a_magic; /* magic number */
|
||||
unsigned long a_spare1;
|
||||
unsigned long a_spare2;
|
||||
unsigned long a_text; /* length of text, in bytes */
|
||||
unsigned long a_data; /* length of data, in bytes */
|
||||
unsigned long a_bss; /* length of uninitialized data area for file, in bytes */
|
||||
unsigned long a_trsize; /* length of relocation info for text, in bytes */
|
||||
unsigned long a_drsize; /* length of relocation info for data, in bytes */
|
||||
unsigned long a_spare3; /* HP = pascal interface size */
|
||||
unsigned long a_spare4; /* HP = symbol table size */
|
||||
unsigned long a_spare5; /* HP = debug name table size */
|
||||
unsigned long a_entry; /* start address */
|
||||
unsigned long a_spare6; /* HP = source line table size */
|
||||
unsigned long a_spare7; /* HP = value table size */
|
||||
unsigned long a_syms; /* length of symbol table data in file, in bytes */
|
||||
unsigned long a_spare8;
|
||||
};
|
||||
|
||||
/* Tell a.out.gnu.h not to define `struct exec'. */
|
||||
#define __STRUCT_EXEC_OVERRIDE__
|
||||
|
||||
#include "../a.out.gnu.h"
|
||||
|
||||
#undef N_MAGIC
|
||||
#undef N_MACHTYPE
|
||||
#undef N_FLAGS
|
||||
#undef N_SET_INFO
|
||||
#undef N_SET_MAGIC
|
||||
#undef N_SET_MACHTYPE
|
||||
#undef N_SET_FLAGS
|
||||
|
||||
#define N_MAGIC(exec) ((exec) . a_magic)
|
||||
#define N_MACHTYPE(exec) ((exec) . a_machtype)
|
||||
#define N_SET_MAGIC(exec, magic) (((exec) . a_magic) = (magic))
|
||||
#define N_SET_MACHTYPE(exec, machtype) (((exec) . a_machtype) = (machtype))
|
||||
|
||||
#undef N_BADMAG
|
||||
#define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x)))
|
||||
|
||||
#define _N_BADMACH(x) \
|
||||
(((N_MACHTYPE (x)) != HP9000S200_ID) && \
|
||||
((N_MACHTYPE (x)) != HP98x6_ID))
|
||||
|
||||
#define HP98x6_ID 0x20A
|
||||
#define HP9000S200_ID 0x20C
|
||||
|
||||
#undef _N_HDROFF
|
||||
#define _N_HDROFF(x) (SEGMENT_SIZE - (sizeof (struct exec)))
|
||||
|
||||
#define SEGMENT_SIZE 0x1000
|
||||
|
||||
#endif /* __GNU_EXEC_MACROS__ */
|
|
@ -0,0 +1,132 @@
|
|||
/* Special version of <a.out.h> for use under HP-UX.
|
||||
Copyright 1988, 1993, 1995, 2001, 2009, 2010
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
struct hp300hpux_exec_bytes
|
||||
{
|
||||
unsigned char e_info[4]; /* a_machtype/a_magic */
|
||||
unsigned char e_spare1[4];
|
||||
unsigned char e_spare2[4];
|
||||
unsigned char e_text[4]; /* length of text, in bytes */
|
||||
unsigned char e_data[4]; /* length of data, in bytes */
|
||||
unsigned char e_bss[4]; /* length of uninitialized data area , in bytes */
|
||||
unsigned char e_trsize[4]; /* length of relocation info for text, in bytes*/
|
||||
unsigned char e_drsize[4]; /* length of relocation info for data, in bytes*/
|
||||
unsigned char e_passize[4];/* HP = pascal interface size */
|
||||
unsigned char e_syms[4]; /* HP = symbol table size */
|
||||
unsigned char e_spare5[4]; /* HP = debug name table size */
|
||||
unsigned char e_entry[4]; /* start address */
|
||||
unsigned char e_spare6[4]; /* HP = source line table size */
|
||||
unsigned char e_supsize[4];/* HP = value table size */
|
||||
unsigned char e_drelocs[4];
|
||||
unsigned char e_extension[4]; /* file offset of extension */
|
||||
};
|
||||
#define EXEC_BYTES_SIZE 64
|
||||
|
||||
struct hp300hpux_nlist_bytes
|
||||
{
|
||||
unsigned char e_value[4];
|
||||
unsigned char e_type[1];
|
||||
unsigned char e_length[1]; /* length of ascii symbol name */
|
||||
unsigned char e_almod[2]; /* alignment mod */
|
||||
unsigned char e_shlib[2]; /* info about dynamic linking */
|
||||
};
|
||||
#define EXTERNAL_NLIST_SIZE 10
|
||||
|
||||
struct hp300hpux_reloc
|
||||
{
|
||||
unsigned char r_address[4];/* offset of of data to relocate */
|
||||
unsigned char r_index[2]; /* symbol table index of symbol */
|
||||
unsigned char r_type[1]; /* relocation type */
|
||||
unsigned char r_length[1]; /* length of item to reloc */
|
||||
};
|
||||
|
||||
struct hp300hpux_header_extension
|
||||
{
|
||||
unsigned char e_syms[4];
|
||||
unsigned char unique_headers[12*4];
|
||||
unsigned char e_header[2]; /* type of header */
|
||||
unsigned char e_version[2]; /* version */
|
||||
unsigned char e_size[4]; /* bytes following*/
|
||||
unsigned char e_extension[4];/* file offset of next extension */
|
||||
};
|
||||
#define EXTERNAL_EXTENSION_HEADER_SIZE (16*4)
|
||||
|
||||
/* hpux separates object files (0x106) and impure executables (0x107) */
|
||||
/* but the bfd code does not distinguish between them. Since we want to*/
|
||||
/* read hpux .o files, we add an special define and use it below in */
|
||||
/* offset and address calculations. */
|
||||
|
||||
#define HPUX_DOT_O_MAGIC 0x106
|
||||
#define OMAGIC 0x107 /* object file or impure executable. */
|
||||
#define NMAGIC 0x108 /* Code indicating pure executable. */
|
||||
#define ZMAGIC 0x10B /* demand-paged executable. */
|
||||
|
||||
#define N_HEADER_IN_TEXT(x) 0
|
||||
|
||||
#if 0 /* libaout.h only uses the lower 8 bits */
|
||||
#define HP98x6_ID 0x20A
|
||||
#define HP9000S200_ID 0x20C
|
||||
#endif
|
||||
#define HP98x6_ID 0x0A
|
||||
#define HP9000S200_ID 0x0C
|
||||
|
||||
#define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x)))
|
||||
|
||||
#define N_DATADDR(x) \
|
||||
((N_MAGIC (x) == OMAGIC || N_MAGIC (x) == HPUX_DOT_O_MAGIC) \
|
||||
? (N_TXTADDR (x) + N_TXTSIZE (x)) \
|
||||
: (N_SEGSIZE (x) + ((N_TXTADDR (x) + N_TXTSIZE (x) - 1) \
|
||||
& ~ (bfd_vma) (N_SEGSIZE (x) - 1))))
|
||||
|
||||
#define _N_BADMACH(x) \
|
||||
(((N_MACHTYPE (x)) != HP9000S200_ID) && ((N_MACHTYPE (x)) != HP98x6_ID))
|
||||
|
||||
#define _N_BADMAG(x) (N_MAGIC(x) != HPUX_DOT_O_MAGIC \
|
||||
&& N_MAGIC(x) != OMAGIC \
|
||||
&& N_MAGIC(x) != NMAGIC \
|
||||
&& N_MAGIC(x) != ZMAGIC )
|
||||
|
||||
#undef _N_HDROFF
|
||||
#define _N_HDROFF(x) (SEGMENT_SIZE - (sizeof (struct exec)))
|
||||
|
||||
#undef N_DATOFF
|
||||
#undef N_PASOFF
|
||||
#undef N_SYMOFF
|
||||
#undef N_SUPOFF
|
||||
#undef N_TRELOFF
|
||||
#undef N_DRELOFF
|
||||
#undef N_STROFF
|
||||
|
||||
#define N_DATOFF(x) ( N_TXTOFF(x) + N_TXTSIZE(x) )
|
||||
#define N_PASOFF(x) ( N_DATOFF(x) + (x).a_data)
|
||||
#define N_SYMOFF(x) ( N_PASOFF(x) /* + (x).a_passize*/ )
|
||||
#define N_SUPOFF(x) ( N_SYMOFF(x) + (x).a_syms )
|
||||
#define N_TRELOFF(x) ( N_SUPOFF(x) /* + 0 (x).a_supsize*/ )
|
||||
#define N_DRELOFF(x) ( N_TRELOFF(x) + (x).a_trsize )
|
||||
#define N_EXTHOFF(x) ( N_DRELOFF(x) /* + 0 (x).a_drsize */)
|
||||
#define N_STROFF(x) ( 0 /* no string table */ )
|
||||
|
||||
/* use these when the file has gnu symbol tables */
|
||||
#define N_GNU_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
|
||||
#define N_GNU_DRELOFF(x) (N_GNU_TRELOFF(x) + (x).a_trsize)
|
||||
#define N_GNU_SYMOFF(x) (N_GNU_DRELOFF(x) + (x).a_drsize)
|
||||
|
||||
#define TARGET_PAGE_SIZE 0x1000
|
||||
#define SEGMENT_SIZE 0x1000
|
||||
#define TEXT_START_ADDR 0
|
|
@ -0,0 +1,7 @@
|
|||
#include "filehdr.h"
|
||||
#include "aouthdr.h"
|
||||
#include "scnhdr.h"
|
||||
#include "spacehdr.h"
|
||||
#include "syms.h"
|
||||
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
/* ranlib.h -- archive library index member definition for GNU.
|
||||
Copyright 1990, 1991, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* The Symdef member of an archive contains two things:
|
||||
a table that maps symbol-string offsets to file offsets,
|
||||
and a symbol-string table. All the symbol names are
|
||||
run together (each with trailing null) in the symbol-string
|
||||
table. There is a single longword bytecount on the front
|
||||
of each of these tables. Thus if we have two symbols,
|
||||
"foo" and "_bar", that are in archive members at offsets
|
||||
200 and 900, it would look like this:
|
||||
16 ; byte count of index table
|
||||
0 ; offset of "foo" in string table
|
||||
200 ; offset of foo-module in file
|
||||
4 ; offset of "bar" in string table
|
||||
900 ; offset of bar-module in file
|
||||
9 ; byte count of string table
|
||||
"foo\0_bar\0" ; string table */
|
||||
|
||||
#define RANLIBMAG "__.SYMDEF" /* Archive file name containing index */
|
||||
#define RANLIBSKEW 3 /* Creation time offset */
|
||||
|
||||
/* Format of __.SYMDEF:
|
||||
First, a longword containing the size of the 'symdef' data that follows.
|
||||
Second, zero or more 'symdef' structures.
|
||||
Third, a longword containing the length of symbol name strings.
|
||||
Fourth, zero or more symbol name strings (each followed by a null). */
|
||||
|
||||
struct symdef
|
||||
{
|
||||
union
|
||||
{
|
||||
unsigned long string_offset; /* In the file */
|
||||
char *name; /* In memory, sometimes */
|
||||
} s;
|
||||
/* this points to the front of the file header (AKA member header --
|
||||
a struct ar_hdr), not to the front of the file or into the file).
|
||||
in other words it only tells you which file to read */
|
||||
unsigned long file_offset;
|
||||
};
|
||||
|
||||
/* Compatability with BSD code */
|
||||
|
||||
#define ranlib symdef
|
||||
#define ran_un s
|
||||
#define ran_strx string_offset
|
||||
#define ran_name name
|
||||
#define ran_off file_offset
|
|
@ -0,0 +1,67 @@
|
|||
/* reloc.h -- Header file for relocation information.
|
||||
Copyright 1989, 1990, 1991, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Relocation types for a.out files using reloc_info_extended
|
||||
(SPARC and AMD 29000). */
|
||||
|
||||
#ifndef _RELOC_H_READ_
|
||||
#define _RELOC_H_READ_ 1
|
||||
|
||||
enum reloc_type
|
||||
{
|
||||
RELOC_8, RELOC_16, RELOC_32, /* simple relocations */
|
||||
RELOC_DISP8, RELOC_DISP16, RELOC_DISP32, /* pc-rel displacement */
|
||||
RELOC_WDISP30, RELOC_WDISP22,
|
||||
RELOC_HI22, RELOC_22,
|
||||
RELOC_13, RELOC_LO10,
|
||||
RELOC_SFA_BASE, RELOC_SFA_OFF13,
|
||||
RELOC_BASE10, RELOC_BASE13, RELOC_BASE22, /* P.I.C. (base-relative) */
|
||||
RELOC_PC10, RELOC_PC22, /* for some sort of pc-rel P.I.C. (?) */
|
||||
RELOC_JMP_TBL, /* P.I.C. jump table */
|
||||
RELOC_SEGOFF16, /* reputedly for shared libraries somehow */
|
||||
RELOC_GLOB_DAT, RELOC_JMP_SLOT, RELOC_RELATIVE,
|
||||
RELOC_11,
|
||||
RELOC_WDISP2_14,
|
||||
RELOC_WDISP19,
|
||||
RELOC_HHI22,
|
||||
RELOC_HLO10,
|
||||
|
||||
/* 29K relocation types */
|
||||
RELOC_JUMPTARG, RELOC_CONST, RELOC_CONSTH,
|
||||
|
||||
RELOC_WDISP14, RELOC_WDISP21,
|
||||
|
||||
NO_RELOC
|
||||
};
|
||||
|
||||
#define RELOC_TYPE_NAMES \
|
||||
"8", "16", "32", "DISP8", \
|
||||
"DISP16", "DISP32", "WDISP30", "WDISP22", \
|
||||
"HI22", "22", "13", "LO10", \
|
||||
"SFA_BASE", "SFAOFF13", "BASE10", "BASE13", \
|
||||
"BASE22", "PC10", "PC22", "JMP_TBL", \
|
||||
"SEGOFF16", "GLOB_DAT", "JMP_SLOT", "RELATIVE", \
|
||||
"11", "WDISP2_14", "WDISP19", "HHI22", \
|
||||
"HLO10", \
|
||||
"JUMPTARG", "CONST", "CONSTH", "WDISP14", \
|
||||
"WDISP21", \
|
||||
"NO_RELOC"
|
||||
|
||||
#endif /* _RELOC_H_READ_ */
|
||||
|
||||
/* end of reloc.h */
|
|
@ -0,0 +1,283 @@
|
|||
/* Table of DBX symbol codes for the GNU system.
|
||||
Copyright 1988, 1991, 1992, 1993, 1994, 1996, 1998, 2004, 2010
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* New stab from Solaris 2. This uses an n_type of 0, which in a.out files
|
||||
overlaps the N_UNDF used for ordinary symbols. In ELF files, the
|
||||
debug information is in a different file section, so there is no conflict.
|
||||
This symbol's n_value gives the size of the string section associated
|
||||
with this file. The symbol's n_strx (relative to the just-updated
|
||||
string section start address) gives the name of the source file,
|
||||
e.g. "foo.c", without any path information. The symbol's n_desc gives
|
||||
the count of upcoming symbols associated with this file (not including
|
||||
this one). */
|
||||
/* __define_stab (N_UNDF, 0x00, "UNDF") */
|
||||
|
||||
/* Global variable. Only the name is significant.
|
||||
To find the address, look in the corresponding external symbol. */
|
||||
__define_stab (N_GSYM, 0x20, "GSYM")
|
||||
|
||||
/* Function name for BSD Fortran. Only the name is significant.
|
||||
To find the address, look in the corresponding external symbol. */
|
||||
__define_stab (N_FNAME, 0x22, "FNAME")
|
||||
|
||||
/* Function name or text-segment variable for C. Value is its address.
|
||||
Desc is supposedly starting line number, but GCC doesn't set it
|
||||
and DBX seems not to miss it. */
|
||||
__define_stab (N_FUN, 0x24, "FUN")
|
||||
|
||||
/* Data-segment variable with internal linkage. Value is its address.
|
||||
"Static Sym". */
|
||||
__define_stab (N_STSYM, 0x26, "STSYM")
|
||||
|
||||
/* BSS-segment variable with internal linkage. Value is its address. */
|
||||
__define_stab (N_LCSYM, 0x28, "LCSYM")
|
||||
|
||||
/* Name of main routine. Only the name is significant. */
|
||||
__define_stab (N_MAIN, 0x2a, "MAIN")
|
||||
|
||||
/* Solaris2: Read-only data symbols. */
|
||||
__define_stab (N_ROSYM, 0x2c, "ROSYM")
|
||||
|
||||
/* MacOS X:
|
||||
The beginning of a relocatable function block - including stabs. */
|
||||
__define_stab (N_BNSYM, 0x2e, "BNSYM")
|
||||
|
||||
/* Global symbol in Pascal.
|
||||
Supposedly the value is its line number; I'm skeptical. */
|
||||
__define_stab (N_PC, 0x30, "PC")
|
||||
|
||||
/* Number of symbols: 0, files,,funcs,lines according to Ultrix V4.0. */
|
||||
__define_stab (N_NSYMS, 0x32, "NSYMS")
|
||||
|
||||
/* "No DST map for sym: name, ,0,type,ignored" according to Ultrix V4.0. */
|
||||
__define_stab (N_NOMAP, 0x34, "NOMAP")
|
||||
|
||||
/* New stab from Solaris 2. Like N_SO, but for the object file. Two in
|
||||
a row provide the build directory and the relative path of the .o from it.
|
||||
Solaris2 uses this to avoid putting the stabs info into the linked
|
||||
executable; this stab goes into the ".stab.index" section, and the debugger
|
||||
reads the real stabs directly from the .o files instead. */
|
||||
__define_stab (N_OBJ, 0x38, "OBJ")
|
||||
|
||||
/* New stab from Solaris 2. Options for the debugger, related to the
|
||||
source language for this module. E.g. whether to use ANSI
|
||||
integral promotions or traditional integral promotions. */
|
||||
__define_stab (N_OPT, 0x3c, "OPT")
|
||||
|
||||
/* Register variable. Value is number of register. */
|
||||
__define_stab (N_RSYM, 0x40, "RSYM")
|
||||
|
||||
/* Modula-2 compilation unit. Can someone say what info it contains? */
|
||||
__define_stab (N_M2C, 0x42, "M2C")
|
||||
|
||||
/* Line number in text segment. Desc is the line number;
|
||||
value is corresponding address. On Solaris2, the line number is
|
||||
relative to the start of the current function. */
|
||||
__define_stab (N_SLINE, 0x44, "SLINE")
|
||||
|
||||
/* Similar, for data segment. */
|
||||
__define_stab (N_DSLINE, 0x46, "DSLINE")
|
||||
|
||||
/* Similar, for bss segment. */
|
||||
__define_stab (N_BSLINE, 0x48, "BSLINE")
|
||||
|
||||
/* Sun's source-code browser stabs. ?? Don't know what the fields are.
|
||||
Supposedly the field is "path to associated .cb file". THIS VALUE
|
||||
OVERLAPS WITH N_BSLINE! */
|
||||
__define_stab_duplicate (N_BROWS, 0x48, "BROWS")
|
||||
|
||||
/* GNU Modula-2 definition module dependency. Value is the modification time
|
||||
of the definition file. Other is non-zero if it is imported with the
|
||||
GNU M2 keyword %INITIALIZE. Perhaps N_M2C can be used if there
|
||||
are enough empty fields? */
|
||||
__define_stab(N_DEFD, 0x4a, "DEFD")
|
||||
|
||||
/* New in Solaris2. Function start/body/end line numbers. */
|
||||
__define_stab(N_FLINE, 0x4C, "FLINE")
|
||||
|
||||
/* MacOS X: This tells the end of a relocatable function + debugging info. */
|
||||
__define_stab(N_ENSYM, 0x4E, "ENSYM")
|
||||
|
||||
/* THE FOLLOWING TWO STAB VALUES CONFLICT. Happily, one is for Modula-2
|
||||
and one is for C++. Still,... */
|
||||
/* GNU C++ exception variable. Name is variable name. */
|
||||
__define_stab (N_EHDECL, 0x50, "EHDECL")
|
||||
/* Modula2 info "for imc": name,,0,0,0 according to Ultrix V4.0. */
|
||||
__define_stab_duplicate (N_MOD2, 0x50, "MOD2")
|
||||
|
||||
/* GNU C++ `catch' clause. Value is its address. Desc is nonzero if
|
||||
this entry is immediately followed by a CAUGHT stab saying what exception
|
||||
was caught. Multiple CAUGHT stabs means that multiple exceptions
|
||||
can be caught here. If Desc is 0, it means all exceptions are caught
|
||||
here. */
|
||||
__define_stab (N_CATCH, 0x54, "CATCH")
|
||||
|
||||
/* Structure or union element. Value is offset in the structure. */
|
||||
__define_stab (N_SSYM, 0x60, "SSYM")
|
||||
|
||||
/* Solaris2: Last stab emitted for module. */
|
||||
__define_stab (N_ENDM, 0x62, "ENDM")
|
||||
|
||||
/* Name of main source file.
|
||||
Value is starting text address of the compilation.
|
||||
If multiple N_SO's appear, the first to contain a trailing / is the
|
||||
compilation directory. The first to not contain a trailing / is the
|
||||
source file name, relative to the compilation directory. Others (perhaps
|
||||
resulting from cfront) are ignored.
|
||||
On Solaris2, value is undefined, but desc is a source-language code. */
|
||||
|
||||
__define_stab (N_SO, 0x64, "SO")
|
||||
|
||||
/* Apple: This is the stab that associated the .o file with the
|
||||
N_SO stab, in the case where debug info is mostly stored in the .o file. */
|
||||
__define_stab (N_OSO, 0x66, "OSO")
|
||||
|
||||
/* SunPro F77: Name of alias. */
|
||||
__define_stab (N_ALIAS, 0x6c, "ALIAS")
|
||||
|
||||
/* Automatic variable in the stack. Value is offset from frame pointer.
|
||||
Also used for type descriptions. */
|
||||
__define_stab (N_LSYM, 0x80, "LSYM")
|
||||
|
||||
/* Beginning of an include file. Only Sun uses this.
|
||||
In an object file, only the name is significant.
|
||||
The Sun linker puts data into some of the other fields. */
|
||||
__define_stab (N_BINCL, 0x82, "BINCL")
|
||||
|
||||
/* Name of sub-source file (#include file).
|
||||
Value is starting text address of the compilation. */
|
||||
__define_stab (N_SOL, 0x84, "SOL")
|
||||
|
||||
/* Parameter variable. Value is offset from argument pointer.
|
||||
(On most machines the argument pointer is the same as the frame pointer. */
|
||||
__define_stab (N_PSYM, 0xa0, "PSYM")
|
||||
|
||||
/* End of an include file. No name.
|
||||
This and N_BINCL act as brackets around the file's output.
|
||||
In an object file, there is no significant data in this entry.
|
||||
The Sun linker puts data into some of the fields. */
|
||||
__define_stab (N_EINCL, 0xa2, "EINCL")
|
||||
|
||||
/* Alternate entry point. Value is its address. */
|
||||
__define_stab (N_ENTRY, 0xa4, "ENTRY")
|
||||
|
||||
/* Beginning of lexical block.
|
||||
The desc is the nesting level in lexical blocks.
|
||||
The value is the address of the start of the text for the block.
|
||||
The variables declared inside the block *precede* the N_LBRAC symbol.
|
||||
On Solaris2, the value is relative to the start of the current function. */
|
||||
__define_stab (N_LBRAC, 0xc0, "LBRAC")
|
||||
|
||||
/* Place holder for deleted include file. Replaces a N_BINCL and everything
|
||||
up to the corresponding N_EINCL. The Sun linker generates these when
|
||||
it finds multiple identical copies of the symbols from an include file.
|
||||
This appears only in output from the Sun linker. */
|
||||
__define_stab (N_EXCL, 0xc2, "EXCL")
|
||||
|
||||
/* Modula-2 scope information. Can someone say what info it contains? */
|
||||
__define_stab (N_SCOPE, 0xc4, "SCOPE")
|
||||
|
||||
/* Solaris2: Patch Run Time Checker. */
|
||||
__define_stab (N_PATCH, 0xd0, "PATCH")
|
||||
|
||||
/* End of a lexical block. Desc matches the N_LBRAC's desc.
|
||||
The value is the address of the end of the text for the block.
|
||||
On Solaris2, the value is relative to the start of the current function. */
|
||||
__define_stab (N_RBRAC, 0xe0, "RBRAC")
|
||||
|
||||
/* Begin named common block. Only the name is significant. */
|
||||
__define_stab (N_BCOMM, 0xe2, "BCOMM")
|
||||
|
||||
/* End named common block. Only the name is significant
|
||||
(and it should match the N_BCOMM). */
|
||||
__define_stab (N_ECOMM, 0xe4, "ECOMM")
|
||||
|
||||
/* Member of a common block; value is offset within the common block.
|
||||
This should occur within a BCOMM/ECOMM pair. */
|
||||
__define_stab (N_ECOML, 0xe8, "ECOML")
|
||||
|
||||
/* Solaris2: Pascal "with" statement: type,,0,0,offset */
|
||||
__define_stab (N_WITH, 0xea, "WITH")
|
||||
|
||||
/* These STAB's are used on Gould systems for Non-Base register symbols
|
||||
or something like that. FIXME. I have assigned the values at random
|
||||
since I don't have a Gould here. Fixups from Gould folk welcome... */
|
||||
__define_stab (N_NBTEXT, 0xF0, "NBTEXT")
|
||||
__define_stab (N_NBDATA, 0xF2, "NBDATA")
|
||||
__define_stab (N_NBBSS, 0xF4, "NBBSS")
|
||||
__define_stab (N_NBSTS, 0xF6, "NBSTS")
|
||||
__define_stab (N_NBLCS, 0xF8, "NBLCS")
|
||||
|
||||
/* Second symbol entry containing a length-value for the preceding entry.
|
||||
The value is the length. */
|
||||
__define_stab (N_LENG, 0xfe, "LENG")
|
||||
|
||||
/* The above information, in matrix format.
|
||||
|
||||
STAB MATRIX
|
||||
_________________________________________________
|
||||
| 00 - 1F are not dbx stab symbols |
|
||||
| In most cases, the low bit is the EXTernal bit|
|
||||
|
||||
| 00 UNDEF | 02 ABS | 04 TEXT | 06 DATA |
|
||||
| 01 |EXT | 03 |EXT | 05 |EXT | 07 |EXT |
|
||||
|
||||
| 08 BSS | 0A INDR | 0C FN_SEQ | 0E WEAKA |
|
||||
| 09 |EXT | 0B | 0D WEAKU | 0F WEAKT |
|
||||
|
||||
| 10 WEAKD | 12 COMM | 14 SETA | 16 SETT |
|
||||
| 11 WEAKB | 13 | 15 | 17 |
|
||||
|
||||
| 18 SETD | 1A SETB | 1C SETV | 1E WARNING|
|
||||
| 19 | 1B | 1D | 1F FN |
|
||||
|
||||
|_______________________________________________|
|
||||
| Debug entries with bit 01 set are unused. |
|
||||
| 20 GSYM | 22 FNAME | 24 FUN | 26 STSYM |
|
||||
| 28 LCSYM | 2A MAIN | 2C ROSYM | 2E |
|
||||
| 30 PC | 32 NSYMS | 34 NOMAP | 36 |
|
||||
| 38 OBJ | 3A | 3C OPT | 3E |
|
||||
| 40 RSYM | 42 M2C | 44 SLINE | 46 DSLINE |
|
||||
| 48 BSLINE*| 4A DEFD | 4C FLINE | 4E |
|
||||
| 50 EHDECL*| 52 | 54 CATCH | 56 |
|
||||
| 58 | 5A | 5C | 5E |
|
||||
| 60 SSYM | 62 ENDM | 64 SO | 66 |
|
||||
| 68 | 6A | 6C ALIAS | 6E |
|
||||
| 70 | 72 | 74 | 76 |
|
||||
| 78 | 7A | 7C | 7E |
|
||||
| 80 LSYM | 82 BINCL | 84 SOL | 86 |
|
||||
| 88 | 8A | 8C | 8E |
|
||||
| 90 | 92 | 94 | 96 |
|
||||
| 98 | 9A | 9C | 9E |
|
||||
| A0 PSYM | A2 EINCL | A4 ENTRY | A6 |
|
||||
| A8 | AA | AC | AE |
|
||||
| B0 | B2 | B4 | B6 |
|
||||
| B8 | BA | BC | BE |
|
||||
| C0 LBRAC | C2 EXCL | C4 SCOPE | C6 |
|
||||
| C8 | CA | CC | CE |
|
||||
| D0 PATCH | D2 | D4 | D6 |
|
||||
| D8 | DA | DC | DE |
|
||||
| E0 RBRAC | E2 BCOMM | E4 ECOMM | E6 |
|
||||
| E8 ECOML | EA WITH | EC | EE |
|
||||
| F0 | F2 | F4 | F6 |
|
||||
| F8 | FA | FC | FE LENG |
|
||||
+-----------------------------------------------+
|
||||
* 50 EHDECL is also MOD2.
|
||||
* 48 BSLINE is also BROWS.
|
||||
*/
|
|
@ -0,0 +1,55 @@
|
|||
/* gnu_stab.h Definitions for GNU extensions to STABS
|
||||
|
||||
Copyright 2001, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
#ifndef __GNU_STAB__
|
||||
|
||||
/* Indicate the GNU stab.h is in use. */
|
||||
|
||||
#define __GNU_STAB__
|
||||
|
||||
#define __define_stab(NAME, CODE, STRING) NAME=CODE,
|
||||
#define __define_stab_duplicate(NAME, CODE, STRING) NAME=CODE,
|
||||
|
||||
enum __stab_debug_code
|
||||
{
|
||||
#include "aout/stab.def"
|
||||
LAST_UNUSED_STAB_CODE
|
||||
};
|
||||
|
||||
#undef __define_stab
|
||||
|
||||
/* Definitions of "desc" field for N_SO stabs in Solaris2. */
|
||||
|
||||
#define N_SO_AS 1
|
||||
#define N_SO_C 2
|
||||
#define N_SO_ANSI_C 3
|
||||
#define N_SO_CC 4 /* C++ */
|
||||
#define N_SO_FORTRAN 5
|
||||
#define N_SO_PASCAL 6
|
||||
|
||||
/* Solaris2: Floating point type values in basic types. */
|
||||
|
||||
#define NF_NONE 0
|
||||
#define NF_SINGLE 1 /* IEEE 32-bit */
|
||||
#define NF_DOUBLE 2 /* IEEE 64-bit */
|
||||
#define NF_COMPLEX 3 /* Fortran complex */
|
||||
#define NF_COMPLEX16 4 /* Fortran double complex */
|
||||
#define NF_COMPLEX32 5 /* Fortran complex*16 */
|
||||
#define NF_LDOUBLE 6 /* Long double (whatever that is) */
|
||||
|
||||
#endif /* __GNU_STAB_ */
|
|
@ -0,0 +1,239 @@
|
|||
/* SPARC-specific values for a.out files
|
||||
|
||||
Copyright 2001, 2009, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* Some systems, e.g., AIX, may have defined this in header files already
|
||||
included. */
|
||||
#undef TARGET_PAGE_SIZE
|
||||
#define TARGET_PAGE_SIZE 0x2000 /* 8K. aka NBPG in <sys/param.h> */
|
||||
/* Note that some SPARCs have 4K pages, some 8K, some others. */
|
||||
|
||||
#define SEG_SIZE_SPARC TARGET_PAGE_SIZE
|
||||
#define SEG_SIZE_SUN3 0x20000 /* Resolution of r/w protection hw */
|
||||
|
||||
#define TEXT_START_ADDR TARGET_PAGE_SIZE /* Location 0 is not accessible */
|
||||
#define N_HEADER_IN_TEXT(x) 1
|
||||
|
||||
/* Non-default definitions of the accessor macros... */
|
||||
|
||||
/* Segment size varies on Sun-3 versus Sun-4. */
|
||||
|
||||
#define N_SEGSIZE(x) (N_MACHTYPE(x) == M_SPARC? SEG_SIZE_SPARC: \
|
||||
N_MACHTYPE(x) == M_68020? SEG_SIZE_SUN3: \
|
||||
/* Guess? */ TARGET_PAGE_SIZE)
|
||||
|
||||
/* Virtual Address of text segment from the a.out file. For OMAGIC,
|
||||
(almost always "unlinked .o's" these days), should be zero.
|
||||
Sun added a kludge so that shared libraries linked ZMAGIC get
|
||||
an address of zero if a_entry (!!!) is lower than the otherwise
|
||||
expected text address. These kludges have gotta go!
|
||||
For linked files, should reflect reality if we know it. */
|
||||
|
||||
#define N_SHARED_LIB(x) ((x).a_entry < TEXT_START_ADDR \
|
||||
&& (x).a_text >= EXEC_BYTES_SIZE)
|
||||
|
||||
/* This differs from the version in aout64.h (which we override by defining
|
||||
it here) only for NMAGIC (we return TEXT_START_ADDR+EXEC_BYTES_SIZE;
|
||||
they return 0). */
|
||||
|
||||
#define N_TXTADDR(x) \
|
||||
(N_MAGIC(x)==OMAGIC? 0 \
|
||||
: (N_MAGIC(x) == ZMAGIC && (x).a_entry < TEXT_START_ADDR)? 0 \
|
||||
: TEXT_START_ADDR+EXEC_BYTES_SIZE)
|
||||
|
||||
/* When a file is linked against a shared library on SunOS 4, the
|
||||
dynamic bit in the exec header is set, and the first symbol in the
|
||||
symbol table is __DYNAMIC. Its value is the address of the
|
||||
following structure. */
|
||||
|
||||
struct external_sun4_dynamic
|
||||
{
|
||||
/* The version number of the structure. SunOS 4.1.x creates files
|
||||
with version number 3, which is what this structure is based on.
|
||||
According to gdb, version 2 is similar. I believe that version 2
|
||||
used a different type of procedure linkage table, and there may
|
||||
have been other differences. */
|
||||
bfd_byte ld_version[4];
|
||||
/* The virtual address of a 28 byte structure used in debugging.
|
||||
The contents are filled in at run time by ld.so. */
|
||||
bfd_byte ldd[4];
|
||||
/* The virtual address of another structure with information about
|
||||
how to relocate the executable at run time. */
|
||||
bfd_byte ld[4];
|
||||
};
|
||||
|
||||
/* The size of the debugging structure pointed to by the debugger
|
||||
field of __DYNAMIC. */
|
||||
#define EXTERNAL_SUN4_DYNAMIC_DEBUGGER_SIZE (24)
|
||||
|
||||
/* The structure pointed to by the linker field of __DYNAMIC. As far
|
||||
as I can tell, most of the addresses in this structure are offsets
|
||||
within the file, but some are actually virtual addresses. */
|
||||
|
||||
struct internal_sun4_dynamic_link
|
||||
{
|
||||
/* Linked list of loaded objects. This is filled in at runtime by
|
||||
ld.so and probably by dlopen. */
|
||||
unsigned long ld_loaded;
|
||||
|
||||
/* The address of the list of names of shared objects which must be
|
||||
included at runtime. Each entry in the list is 16 bytes: the 4
|
||||
byte address of the string naming the object (e.g., for -lc this
|
||||
is "c"); 4 bytes of flags--the high bit is whether to search for
|
||||
the object using the library path; the 2 byte major version
|
||||
number; the 2 byte minor version number; the 4 byte address of
|
||||
the next entry in the list (zero if this is the last entry). The
|
||||
version numbers seem to only be non-zero when doing library
|
||||
searching. */
|
||||
unsigned long ld_need;
|
||||
|
||||
/* The address of the path to search for the shared objects which
|
||||
must be included. This points to a string in PATH format which
|
||||
is generated from the -L arguments to the linker. According to
|
||||
the man page, ld.so implicitly adds ${LD_LIBRARY_PATH} to the
|
||||
beginning of this string and /lib:/usr/lib:/usr/local/lib to the
|
||||
end. The string is terminated by a null byte. This field is
|
||||
zero if there is no additional path. */
|
||||
unsigned long ld_rules;
|
||||
|
||||
/* The address of the global offset table. This appears to be a
|
||||
virtual address, not a file offset. The first entry in the
|
||||
global offset table seems to be the virtual address of the
|
||||
sun4_dynamic structure (the same value as the __DYNAMIC symbol).
|
||||
The global offset table is used for PIC code to hold the
|
||||
addresses of variables. A dynamically linked file which does not
|
||||
itself contain PIC code has a four byte global offset table. */
|
||||
unsigned long ld_got;
|
||||
|
||||
/* The address of the procedure linkage table. This appears to be a
|
||||
virtual address, not a file offset.
|
||||
|
||||
On a SPARC, the table is composed of 12 byte entries, each of
|
||||
which consists of three instructions. The first entry is
|
||||
sethi %hi(0),%g1
|
||||
jmp %g1
|
||||
nop
|
||||
These instructions are changed by ld.so into a jump directly into
|
||||
ld.so itself. Each subsequent entry is
|
||||
save %sp, -96, %sp
|
||||
call <address of first entry in procedure linkage table>
|
||||
<reloc_number | 0x01000000>
|
||||
The reloc_number is the number of the reloc to use to resolve
|
||||
this entry. The reloc will be a JMP_SLOT reloc against some
|
||||
symbol that is not defined in this object file but should be
|
||||
defined in a shared object (if it is not, ld.so will report a
|
||||
runtime error and exit). The constant 0x010000000 turns the
|
||||
reloc number into a sethi of %g0, which does nothing since %g0 is
|
||||
hardwired to zero.
|
||||
|
||||
When one of these entries is executed, it winds up calling into
|
||||
ld.so. ld.so looks at the reloc number, available via the return
|
||||
address, to determine which entry this is. It then looks at the
|
||||
reloc and patches up the entry in the table into a sethi and jmp
|
||||
to the real address followed by a nop. This means that the reloc
|
||||
lookup only has to happen once, and it also means that the
|
||||
relocation only needs to be done if the function is actually
|
||||
called. The relocation is expensive because ld.so must look up
|
||||
the symbol by name.
|
||||
|
||||
The size of the procedure linkage table is given by the ld_plt_sz
|
||||
field. */
|
||||
unsigned long ld_plt;
|
||||
|
||||
/* The address of the relocs. These are in the same format as
|
||||
ordinary relocs. Symbol index numbers refer to the symbols
|
||||
pointed to by ld_stab. I think the only way to determine the
|
||||
number of relocs is to assume that all the bytes from ld_rel to
|
||||
ld_hash contain reloc entries. */
|
||||
unsigned long ld_rel;
|
||||
|
||||
/* The address of a hash table of symbols. The hash table has
|
||||
roughly the same number of entries as there are dynamic symbols;
|
||||
I think the only way to get the exact size is to assume that
|
||||
every byte from ld_hash to ld_stab is devoted to the hash table.
|
||||
|
||||
Each entry in the hash table is eight bytes. The first four
|
||||
bytes are a symbol index into the dynamic symbols. The second
|
||||
four bytes are the index of the next hash table entry in the
|
||||
bucket. The ld_buckets field gives the number of buckets, say B.
|
||||
The first B entries in the hash table each start a bucket which
|
||||
is chained through the second four bytes of each entry. A value
|
||||
of zero ends the chain.
|
||||
|
||||
The hash function is simply
|
||||
h = 0;
|
||||
while (*string != '\0')
|
||||
h = (h << 1) + *string++;
|
||||
h &= 0x7fffffff;
|
||||
|
||||
To look up a symbol, compute the hash value of the name. Take
|
||||
the modulos of hash value and the number of buckets. Start at
|
||||
that entry in the hash table. See if the symbol (from the first
|
||||
four bytes of the hash table entry) has the name you are looking
|
||||
for. If not, use the chain field (the second four bytes of the
|
||||
hash table entry) to move on to the next entry in this bucket.
|
||||
If the chain field is zero you have reached the end of the
|
||||
bucket, and the symbol is not in the hash table. */
|
||||
unsigned long ld_hash;
|
||||
|
||||
/* The address of the symbol table. This is a list of
|
||||
external_nlist structures. The string indices are relative to
|
||||
the ld_symbols field. I think the only way to determine the
|
||||
number of symbols is to assume that all the bytes between ld_stab
|
||||
and ld_symbols are external_nlist structures. */
|
||||
unsigned long ld_stab;
|
||||
|
||||
/* I don't know what this is for. It seems to always be zero. */
|
||||
unsigned long ld_stab_hash;
|
||||
|
||||
/* The number of buckets in the hash table. */
|
||||
unsigned long ld_buckets;
|
||||
|
||||
/* The address of the symbol string table. The first string in this
|
||||
string table need not be the empty string. */
|
||||
unsigned long ld_symbols;
|
||||
|
||||
/* The size in bytes of the symbol string table. */
|
||||
unsigned long ld_symb_size;
|
||||
|
||||
/* The size in bytes of the text segment. */
|
||||
unsigned long ld_text;
|
||||
|
||||
/* The size in bytes of the procedure linkage table. */
|
||||
unsigned long ld_plt_sz;
|
||||
};
|
||||
|
||||
/* The external form of the structure. */
|
||||
|
||||
struct external_sun4_dynamic_link
|
||||
{
|
||||
bfd_byte ld_loaded[4];
|
||||
bfd_byte ld_need[4];
|
||||
bfd_byte ld_rules[4];
|
||||
bfd_byte ld_got[4];
|
||||
bfd_byte ld_plt[4];
|
||||
bfd_byte ld_rel[4];
|
||||
bfd_byte ld_hash[4];
|
||||
bfd_byte ld_stab[4];
|
||||
bfd_byte ld_stab_hash[4];
|
||||
bfd_byte ld_buckets[4];
|
||||
bfd_byte ld_symbols[4];
|
||||
bfd_byte ld_symb_size[4];
|
||||
bfd_byte ld_text[4];
|
||||
bfd_byte ld_plt_sz[4];
|
||||
};
|
|
@ -0,0 +1,786 @@
|
|||
/* bfdlink.h -- header file for BFD link routines
|
||||
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#ifndef BFDLINK_H
|
||||
#define BFDLINK_H
|
||||
|
||||
/* Which symbols to strip during a link. */
|
||||
enum bfd_link_strip
|
||||
{
|
||||
strip_none, /* Don't strip any symbols. */
|
||||
strip_debugger, /* Strip debugging symbols. */
|
||||
strip_some, /* keep_hash is the list of symbols to keep. */
|
||||
strip_all /* Strip all symbols. */
|
||||
};
|
||||
|
||||
/* Which local symbols to discard during a link. This is irrelevant
|
||||
if strip_all is used. */
|
||||
enum bfd_link_discard
|
||||
{
|
||||
discard_sec_merge, /* Discard local temporary symbols in SEC_MERGE
|
||||
sections. */
|
||||
discard_none, /* Don't discard any locals. */
|
||||
discard_l, /* Discard local temporary symbols. */
|
||||
discard_all /* Discard all locals. */
|
||||
};
|
||||
|
||||
/* Describes the type of hash table entry structure being used.
|
||||
Different hash table structure have different fields and so
|
||||
support different linking features. */
|
||||
enum bfd_link_hash_table_type
|
||||
{
|
||||
bfd_link_generic_hash_table,
|
||||
bfd_link_elf_hash_table
|
||||
};
|
||||
|
||||
/* These are the possible types of an entry in the BFD link hash
|
||||
table. */
|
||||
|
||||
enum bfd_link_hash_type
|
||||
{
|
||||
bfd_link_hash_new, /* Symbol is new. */
|
||||
bfd_link_hash_undefined, /* Symbol seen before, but undefined. */
|
||||
bfd_link_hash_undefweak, /* Symbol is weak and undefined. */
|
||||
bfd_link_hash_defined, /* Symbol is defined. */
|
||||
bfd_link_hash_defweak, /* Symbol is weak and defined. */
|
||||
bfd_link_hash_common, /* Symbol is common. */
|
||||
bfd_link_hash_indirect, /* Symbol is an indirect link. */
|
||||
bfd_link_hash_warning /* Like indirect, but warn if referenced. */
|
||||
};
|
||||
|
||||
enum bfd_link_common_skip_ar_symbols
|
||||
{
|
||||
bfd_link_common_skip_none,
|
||||
bfd_link_common_skip_text,
|
||||
bfd_link_common_skip_data,
|
||||
bfd_link_common_skip_all
|
||||
};
|
||||
|
||||
struct bfd_link_hash_common_entry
|
||||
{
|
||||
unsigned int alignment_power; /* Alignment. */
|
||||
asection *section; /* Symbol section. */
|
||||
};
|
||||
|
||||
/* The linking routines use a hash table which uses this structure for
|
||||
its elements. */
|
||||
|
||||
struct bfd_link_hash_entry
|
||||
{
|
||||
/* Base hash table entry structure. */
|
||||
struct bfd_hash_entry root;
|
||||
|
||||
/* Type of this entry. */
|
||||
enum bfd_link_hash_type type;
|
||||
|
||||
/* A union of information depending upon the type. */
|
||||
union
|
||||
{
|
||||
/* Nothing is kept for bfd_hash_new. */
|
||||
/* bfd_link_hash_undefined, bfd_link_hash_undefweak. */
|
||||
struct
|
||||
{
|
||||
/* Undefined and common symbols are kept in a linked list through
|
||||
this field. This field is present in all of the union element
|
||||
so that we don't need to remove entries from the list when we
|
||||
change their type. Removing entries would either require the
|
||||
list to be doubly linked, which would waste more memory, or
|
||||
require a traversal. When an undefined or common symbol is
|
||||
created, it should be added to this list, the head of which is in
|
||||
the link hash table itself. As symbols are defined, they need
|
||||
not be removed from the list; anything which reads the list must
|
||||
doublecheck the symbol type.
|
||||
|
||||
Weak symbols are not kept on this list.
|
||||
|
||||
Defined and defweak symbols use this field as a reference marker.
|
||||
If the field is not NULL, or this structure is the tail of the
|
||||
undefined symbol list, the symbol has been referenced. If the
|
||||
symbol is undefined and becomes defined, this field will
|
||||
automatically be non-NULL since the symbol will have been on the
|
||||
undefined symbol list. */
|
||||
struct bfd_link_hash_entry *next;
|
||||
bfd *abfd; /* BFD symbol was found in. */
|
||||
bfd *weak; /* BFD weak symbol was found in. */
|
||||
} undef;
|
||||
/* bfd_link_hash_defined, bfd_link_hash_defweak. */
|
||||
struct
|
||||
{
|
||||
struct bfd_link_hash_entry *next;
|
||||
asection *section; /* Symbol section. */
|
||||
bfd_vma value; /* Symbol value. */
|
||||
} def;
|
||||
/* bfd_link_hash_indirect, bfd_link_hash_warning. */
|
||||
struct
|
||||
{
|
||||
struct bfd_link_hash_entry *next;
|
||||
struct bfd_link_hash_entry *link; /* Real symbol. */
|
||||
const char *warning; /* Warning (bfd_link_hash_warning only). */
|
||||
} i;
|
||||
/* bfd_link_hash_common. */
|
||||
struct
|
||||
{
|
||||
struct bfd_link_hash_entry *next;
|
||||
/* The linker needs to know three things about common
|
||||
symbols: the size, the alignment, and the section in
|
||||
which the symbol should be placed. We store the size
|
||||
here, and we allocate a small structure to hold the
|
||||
section and the alignment. The alignment is stored as a
|
||||
power of two. We don't store all the information
|
||||
directly because we don't want to increase the size of
|
||||
the union; this structure is a major space user in the
|
||||
linker. */
|
||||
struct bfd_link_hash_common_entry *p;
|
||||
bfd_size_type size; /* Common symbol size. */
|
||||
} c;
|
||||
} u;
|
||||
};
|
||||
|
||||
/* This is the link hash table. It is a derived class of
|
||||
bfd_hash_table. */
|
||||
|
||||
struct bfd_link_hash_table
|
||||
{
|
||||
/* The hash table itself. */
|
||||
struct bfd_hash_table table;
|
||||
/* A linked list of undefined and common symbols, linked through the
|
||||
next field in the bfd_link_hash_entry structure. */
|
||||
struct bfd_link_hash_entry *undefs;
|
||||
/* Entries are added to the tail of the undefs list. */
|
||||
struct bfd_link_hash_entry *undefs_tail;
|
||||
/* The type of the link hash table. */
|
||||
enum bfd_link_hash_table_type type;
|
||||
};
|
||||
|
||||
/* Look up an entry in a link hash table. If FOLLOW is TRUE, this
|
||||
follows bfd_link_hash_indirect and bfd_link_hash_warning links to
|
||||
the real symbol. */
|
||||
extern struct bfd_link_hash_entry *bfd_link_hash_lookup
|
||||
(struct bfd_link_hash_table *, const char *, bfd_boolean create,
|
||||
bfd_boolean copy, bfd_boolean follow);
|
||||
|
||||
/* Look up an entry in the main linker hash table if the symbol might
|
||||
be wrapped. This should only be used for references to an
|
||||
undefined symbol, not for definitions of a symbol. */
|
||||
|
||||
extern struct bfd_link_hash_entry *bfd_wrapped_link_hash_lookup
|
||||
(bfd *, struct bfd_link_info *, const char *, bfd_boolean,
|
||||
bfd_boolean, bfd_boolean);
|
||||
|
||||
/* Traverse a link hash table. */
|
||||
extern void bfd_link_hash_traverse
|
||||
(struct bfd_link_hash_table *,
|
||||
bfd_boolean (*) (struct bfd_link_hash_entry *, void *),
|
||||
void *);
|
||||
|
||||
/* Add an entry to the undefs list. */
|
||||
extern void bfd_link_add_undef
|
||||
(struct bfd_link_hash_table *, struct bfd_link_hash_entry *);
|
||||
|
||||
/* Remove symbols from the undefs list that don't belong there. */
|
||||
extern void bfd_link_repair_undef_list
|
||||
(struct bfd_link_hash_table *table);
|
||||
|
||||
/* Read symbols and cache symbol pointer array in outsymbols. */
|
||||
extern bfd_boolean bfd_generic_link_read_symbols (bfd *);
|
||||
|
||||
struct bfd_sym_chain
|
||||
{
|
||||
struct bfd_sym_chain *next;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
/* How to handle unresolved symbols.
|
||||
There are four possibilities which are enumerated below: */
|
||||
enum report_method
|
||||
{
|
||||
/* This is the initial value when then link_info structure is created.
|
||||
It allows the various stages of the linker to determine whether they
|
||||
allowed to set the value. */
|
||||
RM_NOT_YET_SET = 0,
|
||||
RM_IGNORE,
|
||||
RM_GENERATE_WARNING,
|
||||
RM_GENERATE_ERROR
|
||||
};
|
||||
|
||||
struct bfd_elf_dynamic_list;
|
||||
|
||||
/* This structure holds all the information needed to communicate
|
||||
between BFD and the linker when doing a link. */
|
||||
|
||||
struct bfd_link_info
|
||||
{
|
||||
/* TRUE if BFD should generate a relocatable object file. */
|
||||
unsigned int relocatable: 1;
|
||||
|
||||
/* TRUE if BFD should generate relocation information in the final
|
||||
executable. */
|
||||
unsigned int emitrelocations: 1;
|
||||
|
||||
/* TRUE if BFD should generate a "task linked" object file,
|
||||
similar to relocatable but also with globals converted to
|
||||
statics. */
|
||||
unsigned int task_link: 1;
|
||||
|
||||
/* TRUE if BFD should generate a shared object. */
|
||||
unsigned int shared: 1;
|
||||
|
||||
/* TRUE if BFD should pre-bind symbols in a shared object. */
|
||||
unsigned int symbolic: 1;
|
||||
|
||||
/* TRUE if BFD should export all symbols in the dynamic symbol table
|
||||
of an executable, rather than only those used. */
|
||||
unsigned int export_dynamic: 1;
|
||||
|
||||
/* TRUE if shared objects should be linked directly, not shared. */
|
||||
unsigned int static_link: 1;
|
||||
|
||||
/* TRUE if the output file should be in a traditional format. This
|
||||
is equivalent to the setting of the BFD_TRADITIONAL_FORMAT flag
|
||||
on the output file, but may be checked when reading the input
|
||||
files. */
|
||||
unsigned int traditional_format: 1;
|
||||
|
||||
/* TRUE if we want to produced optimized output files. This might
|
||||
need much more time and therefore must be explicitly selected. */
|
||||
unsigned int optimize: 1;
|
||||
|
||||
/* TRUE if ok to have multiple definition. */
|
||||
unsigned int allow_multiple_definition: 1;
|
||||
|
||||
/* TRUE if ok to have version with no definition. */
|
||||
unsigned int allow_undefined_version: 1;
|
||||
|
||||
/* TRUE if a default symbol version should be created and used for
|
||||
exported symbols. */
|
||||
unsigned int create_default_symver: 1;
|
||||
|
||||
/* TRUE if a default symbol version should be created and used for
|
||||
imported symbols. */
|
||||
unsigned int default_imported_symver: 1;
|
||||
|
||||
/* TRUE if symbols should be retained in memory, FALSE if they
|
||||
should be freed and reread. */
|
||||
unsigned int keep_memory: 1;
|
||||
|
||||
/* TRUE if every symbol should be reported back via the notice
|
||||
callback. */
|
||||
unsigned int notice_all: 1;
|
||||
|
||||
/* TRUE if executable should not contain copy relocs.
|
||||
Setting this true may result in a non-sharable text segment. */
|
||||
unsigned int nocopyreloc: 1;
|
||||
|
||||
/* TRUE if the new ELF dynamic tags are enabled. */
|
||||
unsigned int new_dtags: 1;
|
||||
|
||||
/* TRUE if non-PLT relocs should be merged into one reloc section
|
||||
and sorted so that relocs against the same symbol come together. */
|
||||
unsigned int combreloc: 1;
|
||||
|
||||
/* TRUE if .eh_frame_hdr section and PT_GNU_EH_FRAME ELF segment
|
||||
should be created. */
|
||||
unsigned int eh_frame_hdr: 1;
|
||||
|
||||
/* TRUE if global symbols in discarded sections should be stripped. */
|
||||
unsigned int strip_discarded: 1;
|
||||
|
||||
/* TRUE if generating a position independent executable. */
|
||||
unsigned int pie: 1;
|
||||
|
||||
/* TRUE if generating an executable, position independent or not. */
|
||||
unsigned int executable : 1;
|
||||
|
||||
/* TRUE if PT_GNU_STACK segment should be created with PF_R|PF_W|PF_X
|
||||
flags. */
|
||||
unsigned int execstack: 1;
|
||||
|
||||
/* TRUE if PT_GNU_STACK segment should be created with PF_R|PF_W
|
||||
flags. */
|
||||
unsigned int noexecstack: 1;
|
||||
|
||||
/* TRUE if PT_GNU_RELRO segment should be created. */
|
||||
unsigned int relro: 1;
|
||||
|
||||
/* TRUE if we should warn when adding a DT_TEXTREL to a shared object. */
|
||||
unsigned int warn_shared_textrel: 1;
|
||||
|
||||
/* TRUE if we should warn alternate ELF machine code. */
|
||||
unsigned int warn_alternate_em: 1;
|
||||
|
||||
/* TRUE if unreferenced sections should be removed. */
|
||||
unsigned int gc_sections: 1;
|
||||
|
||||
/* TRUE if user shoudl be informed of removed unreferenced sections. */
|
||||
unsigned int print_gc_sections: 1;
|
||||
|
||||
/* TRUE if .hash section should be created. */
|
||||
unsigned int emit_hash: 1;
|
||||
|
||||
/* TRUE if .gnu.hash section should be created. */
|
||||
unsigned int emit_gnu_hash: 1;
|
||||
|
||||
/* If TRUE reduce memory overheads, at the expense of speed. This will
|
||||
cause map file generation to use an O(N^2) algorithm and disable
|
||||
caching ELF symbol buffer. */
|
||||
unsigned int reduce_memory_overheads: 1;
|
||||
|
||||
/* TRUE if all data symbols should be dynamic. */
|
||||
unsigned int dynamic_data: 1;
|
||||
|
||||
/* TRUE if some symbols have to be dynamic, controlled by
|
||||
--dynamic-list command line options. */
|
||||
unsigned int dynamic: 1;
|
||||
|
||||
/* Non-NULL if .note.gnu.build-id section should be created. */
|
||||
char *emit_note_gnu_build_id;
|
||||
|
||||
/* What to do with unresolved symbols in an object file.
|
||||
When producing executables the default is GENERATE_ERROR.
|
||||
When producing shared libraries the default is IGNORE. The
|
||||
assumption with shared libraries is that the reference will be
|
||||
resolved at load/execution time. */
|
||||
enum report_method unresolved_syms_in_objects;
|
||||
|
||||
/* What to do with unresolved symbols in a shared library.
|
||||
The same defaults apply. */
|
||||
enum report_method unresolved_syms_in_shared_libs;
|
||||
|
||||
/* Which symbols to strip. */
|
||||
enum bfd_link_strip strip;
|
||||
|
||||
/* Which local symbols to discard. */
|
||||
enum bfd_link_discard discard;
|
||||
|
||||
/* Criteria for skipping symbols when determining
|
||||
whether to include an object from an archive. */
|
||||
enum bfd_link_common_skip_ar_symbols common_skip_ar_symbols;
|
||||
|
||||
/* Char that may appear as the first char of a symbol, but should be
|
||||
skipped (like symbol_leading_char) when looking up symbols in
|
||||
wrap_hash. Used by PowerPC Linux for 'dot' symbols. */
|
||||
char wrap_char;
|
||||
|
||||
/* Separator between archive and filename in linker script filespecs. */
|
||||
char path_separator;
|
||||
|
||||
/* Function callbacks. */
|
||||
const struct bfd_link_callbacks *callbacks;
|
||||
|
||||
/* Hash table handled by BFD. */
|
||||
struct bfd_link_hash_table *hash;
|
||||
|
||||
/* Hash table of symbols to keep. This is NULL unless strip is
|
||||
strip_some. */
|
||||
struct bfd_hash_table *keep_hash;
|
||||
|
||||
/* Hash table of symbols to report back via the notice callback. If
|
||||
this is NULL, and notice_all is FALSE, then no symbols are
|
||||
reported back. */
|
||||
struct bfd_hash_table *notice_hash;
|
||||
|
||||
/* Hash table of symbols which are being wrapped (the --wrap linker
|
||||
option). If this is NULL, no symbols are being wrapped. */
|
||||
struct bfd_hash_table *wrap_hash;
|
||||
|
||||
/* The output BFD. */
|
||||
bfd *output_bfd;
|
||||
|
||||
/* The list of input BFD's involved in the link. These are chained
|
||||
together via the link_next field. */
|
||||
bfd *input_bfds;
|
||||
bfd **input_bfds_tail;
|
||||
|
||||
/* If a symbol should be created for each input BFD, this is section
|
||||
where those symbols should be placed. It must be a section in
|
||||
the output BFD. It may be NULL, in which case no such symbols
|
||||
will be created. This is to support CREATE_OBJECT_SYMBOLS in the
|
||||
linker command language. */
|
||||
asection *create_object_symbols_section;
|
||||
|
||||
/* List of global symbol names that are starting points for marking
|
||||
sections against garbage collection. */
|
||||
struct bfd_sym_chain *gc_sym_list;
|
||||
|
||||
/* If a base output file is wanted, then this points to it */
|
||||
void *base_file;
|
||||
|
||||
/* The function to call when the executable or shared object is
|
||||
loaded. */
|
||||
const char *init_function;
|
||||
|
||||
/* The function to call when the executable or shared object is
|
||||
unloaded. */
|
||||
const char *fini_function;
|
||||
|
||||
/* Number of relaxation passes. Usually only one relaxation pass
|
||||
is needed. But a backend can have as many relaxation passes as
|
||||
necessary. During bfd_relax_section call, it is set to the
|
||||
current pass, starting from 0. */
|
||||
int relax_pass;
|
||||
|
||||
/* Number of relaxation trips. This number is incremented every
|
||||
time the relaxation pass is restarted due to a previous
|
||||
relaxation returning true in *AGAIN. */
|
||||
int relax_trip;
|
||||
|
||||
/* Non-zero if auto-import thunks for DATA items in pei386 DLLs
|
||||
should be generated/linked against. Set to 1 if this feature
|
||||
is explicitly requested by the user, -1 if enabled by default. */
|
||||
int pei386_auto_import;
|
||||
|
||||
/* Non-zero if runtime relocs for DATA items with non-zero addends
|
||||
in pei386 DLLs should be generated. Set to 1 if this feature
|
||||
is explicitly requested by the user, -1 if enabled by default. */
|
||||
int pei386_runtime_pseudo_reloc;
|
||||
|
||||
/* How many spare .dynamic DT_NULL entries should be added? */
|
||||
unsigned int spare_dynamic_tags;
|
||||
|
||||
/* May be used to set DT_FLAGS for ELF. */
|
||||
bfd_vma flags;
|
||||
|
||||
/* May be used to set DT_FLAGS_1 for ELF. */
|
||||
bfd_vma flags_1;
|
||||
|
||||
/* Start and end of RELRO region. */
|
||||
bfd_vma relro_start, relro_end;
|
||||
|
||||
/* List of symbols should be dynamic. */
|
||||
struct bfd_elf_dynamic_list *dynamic_list;
|
||||
};
|
||||
|
||||
/* This structures holds a set of callback functions. These are called
|
||||
by the BFD linker routines. Except for the info functions, the first
|
||||
argument to each callback function is the bfd_link_info structure
|
||||
being used and each function returns a boolean value. If the
|
||||
function returns FALSE, then the BFD function which called it should
|
||||
return with a failure indication. */
|
||||
|
||||
struct bfd_link_callbacks
|
||||
{
|
||||
/* A function which is called when an object is added from an
|
||||
archive. ABFD is the archive element being added. NAME is the
|
||||
name of the symbol which caused the archive element to be pulled
|
||||
in. This function may set *SUBSBFD to point to an alternative
|
||||
BFD from which symbols should in fact be added in place of the
|
||||
original BFD's symbols. */
|
||||
bfd_boolean (*add_archive_element)
|
||||
(struct bfd_link_info *, bfd *abfd, const char *name, bfd **subsbfd);
|
||||
/* A function which is called when a symbol is found with multiple
|
||||
definitions. NAME is the symbol which is defined multiple times.
|
||||
OBFD is the old BFD, OSEC is the old section, OVAL is the old
|
||||
value, NBFD is the new BFD, NSEC is the new section, and NVAL is
|
||||
the new value. OBFD may be NULL. OSEC and NSEC may be
|
||||
bfd_com_section or bfd_ind_section. */
|
||||
bfd_boolean (*multiple_definition)
|
||||
(struct bfd_link_info *, const char *name,
|
||||
bfd *obfd, asection *osec, bfd_vma oval,
|
||||
bfd *nbfd, asection *nsec, bfd_vma nval);
|
||||
/* A function which is called when a common symbol is defined
|
||||
multiple times. NAME is the symbol appearing multiple times.
|
||||
OBFD is the BFD of the existing symbol; it may be NULL if this is
|
||||
not known. OTYPE is the type of the existing symbol, which may
|
||||
be bfd_link_hash_defined, bfd_link_hash_defweak,
|
||||
bfd_link_hash_common, or bfd_link_hash_indirect. If OTYPE is
|
||||
bfd_link_hash_common, OSIZE is the size of the existing symbol.
|
||||
NBFD is the BFD of the new symbol. NTYPE is the type of the new
|
||||
symbol, one of bfd_link_hash_defined, bfd_link_hash_common, or
|
||||
bfd_link_hash_indirect. If NTYPE is bfd_link_hash_common, NSIZE
|
||||
is the size of the new symbol. */
|
||||
bfd_boolean (*multiple_common)
|
||||
(struct bfd_link_info *, const char *name,
|
||||
bfd *obfd, enum bfd_link_hash_type otype, bfd_vma osize,
|
||||
bfd *nbfd, enum bfd_link_hash_type ntype, bfd_vma nsize);
|
||||
/* A function which is called to add a symbol to a set. ENTRY is
|
||||
the link hash table entry for the set itself (e.g.,
|
||||
__CTOR_LIST__). RELOC is the relocation to use for an entry in
|
||||
the set when generating a relocatable file, and is also used to
|
||||
get the size of the entry when generating an executable file.
|
||||
ABFD, SEC and VALUE identify the value to add to the set. */
|
||||
bfd_boolean (*add_to_set)
|
||||
(struct bfd_link_info *, struct bfd_link_hash_entry *entry,
|
||||
bfd_reloc_code_real_type reloc, bfd *abfd, asection *sec, bfd_vma value);
|
||||
/* A function which is called when the name of a g++ constructor or
|
||||
destructor is found. This is only called by some object file
|
||||
formats. CONSTRUCTOR is TRUE for a constructor, FALSE for a
|
||||
destructor. This will use BFD_RELOC_CTOR when generating a
|
||||
relocatable file. NAME is the name of the symbol found. ABFD,
|
||||
SECTION and VALUE are the value of the symbol. */
|
||||
bfd_boolean (*constructor)
|
||||
(struct bfd_link_info *, bfd_boolean constructor, const char *name,
|
||||
bfd *abfd, asection *sec, bfd_vma value);
|
||||
/* A function which is called to issue a linker warning. For
|
||||
example, this is called when there is a reference to a warning
|
||||
symbol. WARNING is the warning to be issued. SYMBOL is the name
|
||||
of the symbol which triggered the warning; it may be NULL if
|
||||
there is none. ABFD, SECTION and ADDRESS identify the location
|
||||
which trigerred the warning; either ABFD or SECTION or both may
|
||||
be NULL if the location is not known. */
|
||||
bfd_boolean (*warning)
|
||||
(struct bfd_link_info *, const char *warning, const char *symbol,
|
||||
bfd *abfd, asection *section, bfd_vma address);
|
||||
/* A function which is called when a relocation is attempted against
|
||||
an undefined symbol. NAME is the symbol which is undefined.
|
||||
ABFD, SECTION and ADDRESS identify the location from which the
|
||||
reference is made. IS_FATAL indicates whether an undefined symbol is
|
||||
a fatal error or not. In some cases SECTION may be NULL. */
|
||||
bfd_boolean (*undefined_symbol)
|
||||
(struct bfd_link_info *, const char *name, bfd *abfd,
|
||||
asection *section, bfd_vma address, bfd_boolean is_fatal);
|
||||
/* A function which is called when a reloc overflow occurs. ENTRY is
|
||||
the link hash table entry for the symbol the reloc is against.
|
||||
NAME is the name of the local symbol or section the reloc is
|
||||
against, RELOC_NAME is the name of the relocation, and ADDEND is
|
||||
any addend that is used. ABFD, SECTION and ADDRESS identify the
|
||||
location at which the overflow occurs; if this is the result of a
|
||||
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
|
||||
ABFD will be NULL. */
|
||||
bfd_boolean (*reloc_overflow)
|
||||
(struct bfd_link_info *, struct bfd_link_hash_entry *entry,
|
||||
const char *name, const char *reloc_name, bfd_vma addend,
|
||||
bfd *abfd, asection *section, bfd_vma address);
|
||||
/* A function which is called when a dangerous reloc is performed.
|
||||
MESSAGE is an appropriate message.
|
||||
ABFD, SECTION and ADDRESS identify the location at which the
|
||||
problem occurred; if this is the result of a
|
||||
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
|
||||
ABFD will be NULL. */
|
||||
bfd_boolean (*reloc_dangerous)
|
||||
(struct bfd_link_info *, const char *message,
|
||||
bfd *abfd, asection *section, bfd_vma address);
|
||||
/* A function which is called when a reloc is found to be attached
|
||||
to a symbol which is not being written out. NAME is the name of
|
||||
the symbol. ABFD, SECTION and ADDRESS identify the location of
|
||||
the reloc; if this is the result of a
|
||||
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
|
||||
ABFD will be NULL. */
|
||||
bfd_boolean (*unattached_reloc)
|
||||
(struct bfd_link_info *, const char *name,
|
||||
bfd *abfd, asection *section, bfd_vma address);
|
||||
/* A function which is called when a symbol in notice_hash is
|
||||
defined or referenced. NAME is the symbol. ABFD, SECTION and
|
||||
ADDRESS are the value of the symbol. If SECTION is
|
||||
bfd_und_section, this is a reference. */
|
||||
bfd_boolean (*notice)
|
||||
(struct bfd_link_info *, const char *name,
|
||||
bfd *abfd, asection *section, bfd_vma address);
|
||||
/* Error or warning link info message. */
|
||||
void (*einfo)
|
||||
(const char *fmt, ...);
|
||||
/* General link info message. */
|
||||
void (*info)
|
||||
(const char *fmt, ...);
|
||||
/* Message to be printed in linker map file. */
|
||||
void (*minfo)
|
||||
(const char *fmt, ...);
|
||||
/* This callback provides a chance for users of the BFD library to
|
||||
override its decision about whether to place two adjacent sections
|
||||
into the same segment. */
|
||||
bfd_boolean (*override_segment_assignment)
|
||||
(struct bfd_link_info *, bfd * abfd,
|
||||
asection * current_section, asection * previous_section,
|
||||
bfd_boolean new_segment);
|
||||
};
|
||||
|
||||
/* The linker builds link_order structures which tell the code how to
|
||||
include input data in the output file. */
|
||||
|
||||
/* These are the types of link_order structures. */
|
||||
|
||||
enum bfd_link_order_type
|
||||
{
|
||||
bfd_undefined_link_order, /* Undefined. */
|
||||
bfd_indirect_link_order, /* Built from a section. */
|
||||
bfd_data_link_order, /* Set to explicit data. */
|
||||
bfd_section_reloc_link_order, /* Relocate against a section. */
|
||||
bfd_symbol_reloc_link_order /* Relocate against a symbol. */
|
||||
};
|
||||
|
||||
/* This is the link_order structure itself. These form a chain
|
||||
attached to the output section whose contents they are describing. */
|
||||
|
||||
struct bfd_link_order
|
||||
{
|
||||
/* Next link_order in chain. */
|
||||
struct bfd_link_order *next;
|
||||
/* Type of link_order. */
|
||||
enum bfd_link_order_type type;
|
||||
/* Offset within output section. */
|
||||
bfd_vma offset;
|
||||
/* Size within output section. */
|
||||
bfd_size_type size;
|
||||
/* Type specific information. */
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
/* Section to include. If this is used, then
|
||||
section->output_section must be the section the
|
||||
link_order is attached to, section->output_offset must
|
||||
equal the link_order offset field, and section->size
|
||||
must equal the link_order size field. Maybe these
|
||||
restrictions should be relaxed someday. */
|
||||
asection *section;
|
||||
} indirect;
|
||||
struct
|
||||
{
|
||||
/* Size of contents, or zero when contents size == size
|
||||
within output section.
|
||||
A non-zero value allows filling of the output section
|
||||
with an arbitrary repeated pattern. */
|
||||
unsigned int size;
|
||||
/* Data to put into file. */
|
||||
bfd_byte *contents;
|
||||
} data;
|
||||
struct
|
||||
{
|
||||
/* Description of reloc to generate. Used for
|
||||
bfd_section_reloc_link_order and
|
||||
bfd_symbol_reloc_link_order. */
|
||||
struct bfd_link_order_reloc *p;
|
||||
} reloc;
|
||||
} u;
|
||||
};
|
||||
|
||||
/* A linker order of type bfd_section_reloc_link_order or
|
||||
bfd_symbol_reloc_link_order means to create a reloc against a
|
||||
section or symbol, respectively. This is used to implement -Ur to
|
||||
generate relocs for the constructor tables. The
|
||||
bfd_link_order_reloc structure describes the reloc that BFD should
|
||||
create. It is similar to a arelent, but I didn't use arelent
|
||||
because the linker does not know anything about most symbols, and
|
||||
any asymbol structure it creates will be partially meaningless.
|
||||
This information could logically be in the bfd_link_order struct,
|
||||
but I didn't want to waste the space since these types of relocs
|
||||
are relatively rare. */
|
||||
|
||||
struct bfd_link_order_reloc
|
||||
{
|
||||
/* Reloc type. */
|
||||
bfd_reloc_code_real_type reloc;
|
||||
|
||||
union
|
||||
{
|
||||
/* For type bfd_section_reloc_link_order, this is the section
|
||||
the reloc should be against. This must be a section in the
|
||||
output BFD, not any of the input BFDs. */
|
||||
asection *section;
|
||||
/* For type bfd_symbol_reloc_link_order, this is the name of the
|
||||
symbol the reloc should be against. */
|
||||
const char *name;
|
||||
} u;
|
||||
|
||||
/* Addend to use. The object file should contain zero. The BFD
|
||||
backend is responsible for filling in the contents of the object
|
||||
file correctly. For some object file formats (e.g., COFF) the
|
||||
addend must be stored into in the object file, and for some
|
||||
(e.g., SPARC a.out) it is kept in the reloc. */
|
||||
bfd_vma addend;
|
||||
};
|
||||
|
||||
/* Allocate a new link_order for a section. */
|
||||
extern struct bfd_link_order *bfd_new_link_order (bfd *, asection *);
|
||||
|
||||
/* These structures are used to describe version information for the
|
||||
ELF linker. These structures could be manipulated entirely inside
|
||||
BFD, but it would be a pain. Instead, the regular linker sets up
|
||||
these structures, and then passes them into BFD. */
|
||||
|
||||
/* Glob pattern for a version. */
|
||||
|
||||
struct bfd_elf_version_expr
|
||||
{
|
||||
/* Next glob pattern for this version. */
|
||||
struct bfd_elf_version_expr *next;
|
||||
/* Glob pattern. */
|
||||
const char *pattern;
|
||||
/* Set if pattern is not a glob. */
|
||||
unsigned int literal : 1;
|
||||
/* Defined by ".symver". */
|
||||
unsigned int symver : 1;
|
||||
/* Defined by version script. */
|
||||
unsigned int script : 1;
|
||||
/* Pattern type. */
|
||||
#define BFD_ELF_VERSION_C_TYPE 1
|
||||
#define BFD_ELF_VERSION_CXX_TYPE 2
|
||||
#define BFD_ELF_VERSION_JAVA_TYPE 4
|
||||
unsigned int mask : 3;
|
||||
};
|
||||
|
||||
struct bfd_elf_version_expr_head
|
||||
{
|
||||
/* List of all patterns, both wildcards and non-wildcards. */
|
||||
struct bfd_elf_version_expr *list;
|
||||
/* Hash table for non-wildcards. */
|
||||
void *htab;
|
||||
/* Remaining patterns. */
|
||||
struct bfd_elf_version_expr *remaining;
|
||||
/* What kind of pattern types are present in list (bitmask). */
|
||||
unsigned int mask;
|
||||
};
|
||||
|
||||
/* Version dependencies. */
|
||||
|
||||
struct bfd_elf_version_deps
|
||||
{
|
||||
/* Next dependency for this version. */
|
||||
struct bfd_elf_version_deps *next;
|
||||
/* The version which this version depends upon. */
|
||||
struct bfd_elf_version_tree *version_needed;
|
||||
};
|
||||
|
||||
/* A node in the version tree. */
|
||||
|
||||
struct bfd_elf_version_tree
|
||||
{
|
||||
/* Next version. */
|
||||
struct bfd_elf_version_tree *next;
|
||||
/* Name of this version. */
|
||||
const char *name;
|
||||
/* Version number. */
|
||||
unsigned int vernum;
|
||||
/* Regular expressions for global symbols in this version. */
|
||||
struct bfd_elf_version_expr_head globals;
|
||||
/* Regular expressions for local symbols in this version. */
|
||||
struct bfd_elf_version_expr_head locals;
|
||||
/* List of versions which this version depends upon. */
|
||||
struct bfd_elf_version_deps *deps;
|
||||
/* Index of the version name. This is used within BFD. */
|
||||
unsigned int name_indx;
|
||||
/* Whether this version tree was used. This is used within BFD. */
|
||||
int used;
|
||||
/* Matching hook. */
|
||||
struct bfd_elf_version_expr *(*match)
|
||||
(struct bfd_elf_version_expr_head *head,
|
||||
struct bfd_elf_version_expr *prev, const char *sym);
|
||||
};
|
||||
|
||||
struct bfd_elf_dynamic_list
|
||||
{
|
||||
struct bfd_elf_version_expr_head head;
|
||||
struct bfd_elf_version_expr *(*match)
|
||||
(struct bfd_elf_version_expr_head *head,
|
||||
struct bfd_elf_version_expr *prev, const char *sym);
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,62 @@
|
|||
/* Binary mode I/O.
|
||||
Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _BINARY_H
|
||||
#define _BINARY_H
|
||||
|
||||
/* Include this header after <fcntl.h> and <stdio.h>, because
|
||||
systems that distinguish between text and binary I/O usually
|
||||
define O_BINARY in <fcntl.h>, and the MSVC7 <stdio.h> doesn't
|
||||
like to be included after '#define fileno ...'
|
||||
|
||||
We don't include <fcntl.h> here because not all systems have
|
||||
that header. */
|
||||
|
||||
#if !defined O_BINARY && defined _O_BINARY
|
||||
/* For MSC-compatible compilers. */
|
||||
# define O_BINARY _O_BINARY
|
||||
# define O_TEXT _O_TEXT
|
||||
#endif
|
||||
#ifdef __BEOS__
|
||||
/* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
|
||||
# undef O_BINARY
|
||||
# undef O_TEXT
|
||||
#endif
|
||||
#if O_BINARY
|
||||
# if defined __EMX__ || defined __DJGPP__ || defined __CYGWIN__
|
||||
# include <io.h> /* declares setmode() */
|
||||
# else
|
||||
# define setmode _setmode
|
||||
# undef fileno
|
||||
# define fileno _fileno
|
||||
# endif
|
||||
# ifdef __DJGPP__
|
||||
# include <unistd.h> /* declares isatty() */
|
||||
# /* Avoid putting stdin/stdout in binary mode if it is connected to the
|
||||
# console, because that would make it impossible for the user to
|
||||
# interrupt the program through Ctrl-C or Ctrl-Break. */
|
||||
# define SET_BINARY(fd) (!isatty (fd) ? (setmode (fd, O_BINARY), 0) : 0)
|
||||
# else
|
||||
# define SET_BINARY(fd) setmode (fd, O_BINARY)
|
||||
# endif
|
||||
#else
|
||||
/* On reasonable systems, binary I/O is the default. */
|
||||
# undef O_BINARY
|
||||
# define O_BINARY 0
|
||||
# define SET_BINARY(fd) /* nothing */
|
||||
#endif
|
||||
|
||||
#endif /* _BINARY_H */
|
|
@ -0,0 +1,192 @@
|
|||
/* This file is a modified version of 'a.out.h'. It is to be used in all
|
||||
GNU tools modified to support the i80960 (or tools that operate on
|
||||
object files created by such tools).
|
||||
|
||||
Copyright 2001, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* All i80960 development is done in a CROSS-DEVELOPMENT environment. I.e.,
|
||||
object code is generated on, and executed under the direction of a symbolic
|
||||
debugger running on, a host system. We do not want to be subject to the
|
||||
vagaries of which host it is or whether it supports COFF or a.out format,
|
||||
or anything else. We DO want to:
|
||||
|
||||
o always generate the same format object files, regardless of host.
|
||||
|
||||
o have an 'a.out' header that we can modify for our own purposes
|
||||
(the 80960 is typically an embedded processor and may require
|
||||
enhanced linker support that the normal a.out.h header can't
|
||||
accommodate).
|
||||
|
||||
As for byte-ordering, the following rules apply:
|
||||
|
||||
o Text and data that is actually downloaded to the target is always
|
||||
in i80960 (little-endian) order.
|
||||
|
||||
o All other numbers (in the header, symbols, relocation directives)
|
||||
are in host byte-order: object files CANNOT be lifted from a
|
||||
little-end host and used on a big-endian (or vice versa) without
|
||||
modification.
|
||||
==> THIS IS NO LONGER TRUE USING BFD. WE CAN GENERATE ANY BYTE ORDER
|
||||
FOR THE HEADER, AND READ ANY BYTE ORDER. PREFERENCE WOULD BE TO
|
||||
USE LITTLE-ENDIAN BYTE ORDER THROUGHOUT, REGARDLESS OF HOST. <==
|
||||
|
||||
o The downloader ('comm960') takes care to generate a pseudo-header
|
||||
with correct (i80960) byte-ordering before shipping text and data
|
||||
off to the NINDY monitor in the target systems. Symbols and
|
||||
relocation info are never sent to the target. */
|
||||
|
||||
#define BMAGIC 0415
|
||||
/* We don't accept the following (see N_BADMAG macro).
|
||||
They're just here so GNU code will compile. */
|
||||
#define OMAGIC 0407 /* old impure format */
|
||||
#define NMAGIC 0410 /* read-only text */
|
||||
#define ZMAGIC 0413 /* demand load format */
|
||||
|
||||
/* FILE HEADER
|
||||
All 'lengths' are given as a number of bytes.
|
||||
All 'alignments' are for relinkable files only; an alignment of
|
||||
'n' indicates the corresponding segment must begin at an
|
||||
address that is a multiple of (2**n). */
|
||||
struct external_exec
|
||||
{
|
||||
/* Standard stuff */
|
||||
unsigned char e_info[4]; /* Identifies this as a b.out file */
|
||||
unsigned char e_text[4]; /* Length of text */
|
||||
unsigned char e_data[4]; /* Length of data */
|
||||
unsigned char e_bss[4]; /* Length of uninitialized data area */
|
||||
unsigned char e_syms[4]; /* Length of symbol table */
|
||||
unsigned char e_entry[4]; /* Runtime start address */
|
||||
unsigned char e_trsize[4]; /* Length of text relocation info */
|
||||
unsigned char e_drsize[4]; /* Length of data relocation info */
|
||||
|
||||
/* Added for i960 */
|
||||
unsigned char e_tload[4]; /* Text runtime load address */
|
||||
unsigned char e_dload[4]; /* Data runtime load address */
|
||||
unsigned char e_talign[1]; /* Alignment of text segment */
|
||||
unsigned char e_dalign[1]; /* Alignment of data segment */
|
||||
unsigned char e_balign[1]; /* Alignment of bss segment */
|
||||
unsigned char e_relaxable[1];/* Assembled with enough info to allow linker to relax */
|
||||
};
|
||||
|
||||
#define EXEC_BYTES_SIZE (sizeof (struct external_exec))
|
||||
|
||||
/* These macros use the a_xxx field names, since they operate on the exec
|
||||
structure after it's been byte-swapped and realigned on the host machine. */
|
||||
#define N_BADMAG(x) (((x).a_info)!=BMAGIC)
|
||||
#define N_TXTOFF(x) EXEC_BYTES_SIZE
|
||||
#define N_DATOFF(x) ( N_TXTOFF(x) + (x).a_text )
|
||||
#define N_TROFF(x) ( N_DATOFF(x) + (x).a_data )
|
||||
#define N_TRELOFF N_TROFF
|
||||
#define N_DROFF(x) ( N_TROFF(x) + (x).a_trsize )
|
||||
#define N_DRELOFF N_DROFF
|
||||
#define N_SYMOFF(x) ( N_DROFF(x) + (x).a_drsize )
|
||||
#define N_STROFF(x) ( N_SYMOFF(x) + (x).a_syms )
|
||||
#define N_DATADDR(x) ( (x).a_dload )
|
||||
|
||||
/* Address of text segment in memory after it is loaded. */
|
||||
#if !defined (N_TXTADDR)
|
||||
#define N_TXTADDR(x) 0
|
||||
#endif
|
||||
|
||||
/* A single entry in the symbol table. */
|
||||
struct nlist
|
||||
{
|
||||
union
|
||||
{
|
||||
char* n_name;
|
||||
struct nlist * n_next;
|
||||
long n_strx; /* Index into string table */
|
||||
} n_un;
|
||||
|
||||
unsigned char n_type; /* See below */
|
||||
char n_other; /* Used in i80960 support -- see below */
|
||||
short n_desc;
|
||||
unsigned long n_value;
|
||||
};
|
||||
|
||||
|
||||
/* Legal values of n_type. */
|
||||
#define N_UNDF 0 /* Undefined symbol */
|
||||
#define N_ABS 2 /* Absolute symbol */
|
||||
#define N_TEXT 4 /* Text symbol */
|
||||
#define N_DATA 6 /* Data symbol */
|
||||
#define N_BSS 8 /* BSS symbol */
|
||||
#define N_FN 31 /* Filename symbol */
|
||||
|
||||
#define N_EXT 1 /* External symbol (OR'd in with one of above) */
|
||||
#define N_TYPE 036 /* Mask for all the type bits */
|
||||
#define N_STAB 0340 /* Mask for all bits used for SDB entries */
|
||||
|
||||
/* MEANING OF 'n_other'
|
||||
|
||||
If non-zero, the 'n_other' fields indicates either a leaf procedure or
|
||||
a system procedure, as follows:
|
||||
|
||||
1 <= n_other <= 32 :
|
||||
The symbol is the entry point to a system procedure.
|
||||
'n_value' is the address of the entry, as for any other
|
||||
procedure. The system procedure number (which can be used in
|
||||
a 'calls' instruction) is (n_other-1). These entries come from
|
||||
'.sysproc' directives.
|
||||
|
||||
n_other == N_CALLNAME
|
||||
the symbol is the 'call' entry point to a leaf procedure.
|
||||
The *next* symbol in the symbol table must be the corresponding
|
||||
'bal' entry point to the procedure (see following). These
|
||||
entries come from '.leafproc' directives in which two different
|
||||
symbols are specified (the first one is represented here).
|
||||
|
||||
|
||||
n_other == N_BALNAME
|
||||
the symbol is the 'bal' entry point to a leaf procedure.
|
||||
These entries result from '.leafproc' directives in which only
|
||||
one symbol is specified, or in which the same symbol is
|
||||
specified twice.
|
||||
|
||||
Note that an N_CALLNAME entry *must* have a corresponding N_BALNAME entry,
|
||||
but not every N_BALNAME entry must have an N_CALLNAME entry. */
|
||||
#define N_CALLNAME ((char)-1)
|
||||
#define N_BALNAME ((char)-2)
|
||||
#define IS_CALLNAME(x) (N_CALLNAME == (x))
|
||||
#define IS_BALNAME(x) (N_BALNAME == (x))
|
||||
#define IS_OTHER(x) ((x)>0 && (x) <=32)
|
||||
|
||||
#define b_out_relocation_info relocation_info
|
||||
struct relocation_info
|
||||
{
|
||||
int r_address; /* File address of item to be relocated. */
|
||||
unsigned
|
||||
#define r_index r_symbolnum
|
||||
r_symbolnum:24, /* Index of symbol on which relocation is based,
|
||||
if r_extern is set. Otherwise set to
|
||||
either N_TEXT, N_DATA, or N_BSS to
|
||||
indicate section on which relocation is
|
||||
based. */
|
||||
r_pcrel:1, /* 1 => relocate PC-relative; else absolute
|
||||
On i960, pc-relative implies 24-bit
|
||||
address, absolute implies 32-bit. */
|
||||
r_length:2, /* Number of bytes to relocate:
|
||||
0 => 1 byte
|
||||
1 => 2 bytes -- used for 13 bit pcrel
|
||||
2 => 4 bytes. */
|
||||
r_extern:1,
|
||||
r_bsr:1, /* Something for the GNU NS32K assembler. */
|
||||
r_disp:1, /* Something for the GNU NS32K assembler. */
|
||||
r_callj:1, /* 1 if relocation target is an i960 'callj'. */
|
||||
r_relaxable:1; /* 1 if enough info is left to relax the data. */
|
||||
};
|
|
@ -0,0 +1,10 @@
|
|||
2010-01-05 Doug Evans <dje@sebabeach.org>
|
||||
|
||||
* basic-modes.h (MAKEDI): New macro.
|
||||
|
||||
2009-10-23 Doug Evans <dje@sebabeach.org>
|
||||
|
||||
* basic-modes.h: New file. Moved here from opcodes/cgen-types.h.
|
||||
* basic-ops.h: New file. Moved here from opcodes/cgen-ops.h.
|
||||
* bitset.h: New file. Moved here from ../opcode/cgen-bitset.h.
|
||||
Update license to GPL v3.
|
|
@ -0,0 +1,52 @@
|
|||
/* Basic CGEN modes.
|
||||
Copyright 2005, 2007, 2009 Free Software Foundation, Inc.
|
||||
Contributed by Red Hat.
|
||||
|
||||
This file is part of the GNU opcodes library.
|
||||
|
||||
This library 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
It 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 library; see the file COPYING3. If not, write to the
|
||||
Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef CGEN_BASIC_MODES_H
|
||||
#define CGEN_BASIC_MODES_H
|
||||
|
||||
/* This file doesn't contain all modes,
|
||||
just the basic/portable ones.
|
||||
It also provides access to stdint.h (*1) so the includer doesn't have
|
||||
to deal with the portability issues.
|
||||
(*1): To the extent that bfd_stdint.h does for now. */
|
||||
|
||||
/* IWBN to avoid unnecessary dependencies on bfd-anything. */
|
||||
#include "bfd_stdint.h"
|
||||
|
||||
typedef int8_t QI;
|
||||
typedef uint8_t UQI;
|
||||
|
||||
typedef int16_t HI;
|
||||
typedef uint16_t UHI;
|
||||
|
||||
typedef int32_t SI;
|
||||
typedef uint32_t USI;
|
||||
|
||||
typedef int64_t DI;
|
||||
typedef uint64_t UDI;
|
||||
|
||||
typedef int INT;
|
||||
typedef unsigned int UINT;
|
||||
|
||||
/* Cover macro to create a 64-bit integer. */
|
||||
#define MAKEDI(hi, lo) ((((DI) (SI) (hi)) << 32) | ((UDI) (USI) (lo)))
|
||||
|
||||
#endif /* CGEN_BASIC_MODES_H */
|
|
@ -0,0 +1,347 @@
|
|||
/* Basic semantics ops support for CGEN.
|
||||
Copyright 2005, 2007, 2009 Free Software Foundation, Inc.
|
||||
Contributed by Red Hat.
|
||||
|
||||
This file is part of the GNU opcodes library.
|
||||
|
||||
This library 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
It 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 library; see the file COPYING3. If not, write to the
|
||||
Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef CGEN_BASIC_OPS_H
|
||||
#define CGEN_BASIC_OPS_H
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#if defined (__GNUC__) && ! defined (SEMOPS_DEFINE_INLINE)
|
||||
#define SEMOPS_DEFINE_INLINE
|
||||
#define SEMOPS_INLINE extern inline
|
||||
#else
|
||||
#define SEMOPS_INLINE
|
||||
#endif
|
||||
|
||||
/* These don't really have a mode. */
|
||||
#define ANDIF(x, y) ((x) && (y))
|
||||
#define ORIF(x, y) ((x) || (y))
|
||||
|
||||
#define SUBBI(x, y) ((x) - (y))
|
||||
#define ANDBI(x, y) ((x) & (y))
|
||||
#define ORBI(x, y) ((x) | (y))
|
||||
#define XORBI(x, y) ((x) ^ (y))
|
||||
#define NEGBI(x) (- (x))
|
||||
#define NOTBI(x) (! (BI) (x))
|
||||
#define INVBI(x) (~ (x))
|
||||
#define EQBI(x, y) ((BI) (x) == (BI) (y))
|
||||
#define NEBI(x, y) ((BI) (x) != (BI) (y))
|
||||
#define LTBI(x, y) ((BI) (x) < (BI) (y))
|
||||
#define LEBI(x, y) ((BI) (x) <= (BI) (y))
|
||||
#define GTBI(x, y) ((BI) (x) > (BI) (y))
|
||||
#define GEBI(x, y) ((BI) (x) >= (BI) (y))
|
||||
#define LTUBI(x, y) ((BI) (x) < (BI) (y))
|
||||
#define LEUBI(x, y) ((BI) (x) <= (BI) (y))
|
||||
#define GTUBI(x, y) ((BI) (x) > (BI) (y))
|
||||
#define GEUBI(x, y) ((BI) (x) >= (BI) (y))
|
||||
|
||||
#define ADDQI(x, y) ((x) + (y))
|
||||
#define SUBQI(x, y) ((x) - (y))
|
||||
#define MULQI(x, y) ((x) * (y))
|
||||
#define DIVQI(x, y) ((QI) (x) / (QI) (y))
|
||||
#define UDIVQI(x, y) ((UQI) (x) / (UQI) (y))
|
||||
#define MODQI(x, y) ((QI) (x) % (QI) (y))
|
||||
#define UMODQI(x, y) ((UQI) (x) % (UQI) (y))
|
||||
#define SRAQI(x, y) ((QI) (x) >> (y))
|
||||
#define SRLQI(x, y) ((UQI) (x) >> (y))
|
||||
#define SLLQI(x, y) ((UQI) (x) << (y))
|
||||
extern QI RORQI (QI, int);
|
||||
extern QI ROLQI (QI, int);
|
||||
#define ANDQI(x, y) ((x) & (y))
|
||||
#define ORQI(x, y) ((x) | (y))
|
||||
#define XORQI(x, y) ((x) ^ (y))
|
||||
#define NEGQI(x) (- (x))
|
||||
#define NOTQI(x) (! (QI) (x))
|
||||
#define INVQI(x) (~ (x))
|
||||
#define ABSQI(x) ((x) < 0 ? -(x) : (x))
|
||||
#define EQQI(x, y) ((QI) (x) == (QI) (y))
|
||||
#define NEQI(x, y) ((QI) (x) != (QI) (y))
|
||||
#define LTQI(x, y) ((QI) (x) < (QI) (y))
|
||||
#define LEQI(x, y) ((QI) (x) <= (QI) (y))
|
||||
#define GTQI(x, y) ((QI) (x) > (QI) (y))
|
||||
#define GEQI(x, y) ((QI) (x) >= (QI) (y))
|
||||
#define LTUQI(x, y) ((UQI) (x) < (UQI) (y))
|
||||
#define LEUQI(x, y) ((UQI) (x) <= (UQI) (y))
|
||||
#define GTUQI(x, y) ((UQI) (x) > (UQI) (y))
|
||||
#define GEUQI(x, y) ((UQI) (x) >= (UQI) (y))
|
||||
|
||||
#define ADDHI(x, y) ((x) + (y))
|
||||
#define SUBHI(x, y) ((x) - (y))
|
||||
#define MULHI(x, y) ((x) * (y))
|
||||
#define DIVHI(x, y) ((HI) (x) / (HI) (y))
|
||||
#define UDIVHI(x, y) ((UHI) (x) / (UHI) (y))
|
||||
#define MODHI(x, y) ((HI) (x) % (HI) (y))
|
||||
#define UMODHI(x, y) ((UHI) (x) % (UHI) (y))
|
||||
#define SRAHI(x, y) ((HI) (x) >> (y))
|
||||
#define SRLHI(x, y) ((UHI) (x) >> (y))
|
||||
#define SLLHI(x, y) ((UHI) (x) << (y))
|
||||
extern HI RORHI (HI, int);
|
||||
extern HI ROLHI (HI, int);
|
||||
#define ANDHI(x, y) ((x) & (y))
|
||||
#define ORHI(x, y) ((x) | (y))
|
||||
#define XORHI(x, y) ((x) ^ (y))
|
||||
#define NEGHI(x) (- (x))
|
||||
#define NOTHI(x) (! (HI) (x))
|
||||
#define INVHI(x) (~ (x))
|
||||
#define ABSHI(x) ((x) < 0 ? -(x) : (x))
|
||||
#define EQHI(x, y) ((HI) (x) == (HI) (y))
|
||||
#define NEHI(x, y) ((HI) (x) != (HI) (y))
|
||||
#define LTHI(x, y) ((HI) (x) < (HI) (y))
|
||||
#define LEHI(x, y) ((HI) (x) <= (HI) (y))
|
||||
#define GTHI(x, y) ((HI) (x) > (HI) (y))
|
||||
#define GEHI(x, y) ((HI) (x) >= (HI) (y))
|
||||
#define LTUHI(x, y) ((UHI) (x) < (UHI) (y))
|
||||
#define LEUHI(x, y) ((UHI) (x) <= (UHI) (y))
|
||||
#define GTUHI(x, y) ((UHI) (x) > (UHI) (y))
|
||||
#define GEUHI(x, y) ((UHI) (x) >= (UHI) (y))
|
||||
|
||||
#define ADDSI(x, y) ((x) + (y))
|
||||
#define SUBSI(x, y) ((x) - (y))
|
||||
#define MULSI(x, y) ((x) * (y))
|
||||
#define DIVSI(x, y) ((SI) (x) / (SI) (y))
|
||||
#define UDIVSI(x, y) ((USI) (x) / (USI) (y))
|
||||
#define MODSI(x, y) ((SI) (x) % (SI) (y))
|
||||
#define UMODSI(x, y) ((USI) (x) % (USI) (y))
|
||||
#define SRASI(x, y) ((SI) (x) >> (y))
|
||||
#define SRLSI(x, y) ((USI) (x) >> (y))
|
||||
#define SLLSI(x, y) ((USI) (x) << (y))
|
||||
extern SI RORSI (SI, int);
|
||||
extern SI ROLSI (SI, int);
|
||||
#define ANDSI(x, y) ((x) & (y))
|
||||
#define ORSI(x, y) ((x) | (y))
|
||||
#define XORSI(x, y) ((x) ^ (y))
|
||||
#define NEGSI(x) (- (x))
|
||||
#define NOTSI(x) (! (SI) (x))
|
||||
#define INVSI(x) (~ (x))
|
||||
#define ABSSI(x) ((x) < 0 ? -(x) : (x))
|
||||
#define EQSI(x, y) ((SI) (x) == (SI) (y))
|
||||
#define NESI(x, y) ((SI) (x) != (SI) (y))
|
||||
#define LTSI(x, y) ((SI) (x) < (SI) (y))
|
||||
#define LESI(x, y) ((SI) (x) <= (SI) (y))
|
||||
#define GTSI(x, y) ((SI) (x) > (SI) (y))
|
||||
#define GESI(x, y) ((SI) (x) >= (SI) (y))
|
||||
#define LTUSI(x, y) ((USI) (x) < (USI) (y))
|
||||
#define LEUSI(x, y) ((USI) (x) <= (USI) (y))
|
||||
#define GTUSI(x, y) ((USI) (x) > (USI) (y))
|
||||
#define GEUSI(x, y) ((USI) (x) >= (USI) (y))
|
||||
|
||||
#ifdef DI_FN_SUPPORT
|
||||
extern DI ADDDI (DI, DI);
|
||||
extern DI SUBDI (DI, DI);
|
||||
extern DI MULDI (DI, DI);
|
||||
extern DI DIVDI (DI, DI);
|
||||
extern DI UDIVDI (DI, DI);
|
||||
extern DI MODDI (DI, DI);
|
||||
extern DI UMODDI (DI, DI);
|
||||
extern DI SRADI (DI, int);
|
||||
extern UDI SRLDI (UDI, int);
|
||||
extern UDI SLLDI (UDI, int);
|
||||
extern DI RORDI (DI, int);
|
||||
extern DI ROLDI (DI, int);
|
||||
extern DI ANDDI (DI, DI);
|
||||
extern DI ORDI (DI, DI);
|
||||
extern DI XORDI (DI, DI);
|
||||
extern DI NEGDI (DI);
|
||||
extern int NOTDI (DI);
|
||||
extern DI INVDI (DI);
|
||||
extern int EQDI (DI, DI);
|
||||
extern int NEDI (DI, DI);
|
||||
extern int LTDI (DI, DI);
|
||||
extern int LEDI (DI, DI);
|
||||
extern int GTDI (DI, DI);
|
||||
extern int GEDI (DI, DI);
|
||||
extern int LTUDI (UDI, UDI);
|
||||
extern int LEUDI (UDI, UDI);
|
||||
extern int GTUDI (UDI, UDI);
|
||||
extern int GEUDI (UDI, UDI);
|
||||
#else /* ! DI_FN_SUPPORT */
|
||||
#define ADDDI(x, y) ((x) + (y))
|
||||
#define SUBDI(x, y) ((x) - (y))
|
||||
#define MULDI(x, y) ((x) * (y))
|
||||
#define DIVDI(x, y) ((DI) (x) / (DI) (y))
|
||||
#define UDIVDI(x, y) ((UDI) (x) / (UDI) (y))
|
||||
#define MODDI(x, y) ((DI) (x) % (DI) (y))
|
||||
#define UMODDI(x, y) ((UDI) (x) % (UDI) (y))
|
||||
#define SRADI(x, y) ((DI) (x) >> (y))
|
||||
#define SRLDI(x, y) ((UDI) (x) >> (y))
|
||||
#define SLLDI(x, y) ((UDI) (x) << (y))
|
||||
extern DI RORDI (DI, int);
|
||||
extern DI ROLDI (DI, int);
|
||||
#define ANDDI(x, y) ((x) & (y))
|
||||
#define ORDI(x, y) ((x) | (y))
|
||||
#define XORDI(x, y) ((x) ^ (y))
|
||||
#define NEGDI(x) (- (x))
|
||||
#define NOTDI(x) (! (DI) (x))
|
||||
#define INVDI(x) (~ (x))
|
||||
#define ABSDI(x) ((x) < 0 ? -(x) : (x))
|
||||
#define EQDI(x, y) ((DI) (x) == (DI) (y))
|
||||
#define NEDI(x, y) ((DI) (x) != (DI) (y))
|
||||
#define LTDI(x, y) ((DI) (x) < (DI) (y))
|
||||
#define LEDI(x, y) ((DI) (x) <= (DI) (y))
|
||||
#define GTDI(x, y) ((DI) (x) > (DI) (y))
|
||||
#define GEDI(x, y) ((DI) (x) >= (DI) (y))
|
||||
#define LTUDI(x, y) ((UDI) (x) < (UDI) (y))
|
||||
#define LEUDI(x, y) ((UDI) (x) <= (UDI) (y))
|
||||
#define GTUDI(x, y) ((UDI) (x) > (UDI) (y))
|
||||
#define GEUDI(x, y) ((UDI) (x) >= (UDI) (y))
|
||||
#endif /* DI_FN_SUPPORT */
|
||||
|
||||
#define EXTBIQI(x) ((QI) (BI) (x))
|
||||
#define EXTBIHI(x) ((HI) (BI) (x))
|
||||
#define EXTBISI(x) ((SI) (BI) (x))
|
||||
#if defined (DI_FN_SUPPORT)
|
||||
extern DI EXTBIDI (BI);
|
||||
#else
|
||||
#define EXTBIDI(x) ((DI) (BI) (x))
|
||||
#endif
|
||||
#define EXTQIHI(x) ((HI) (QI) (x))
|
||||
#define EXTQISI(x) ((SI) (QI) (x))
|
||||
#if defined (DI_FN_SUPPORT)
|
||||
extern DI EXTQIDI (QI);
|
||||
#else
|
||||
#define EXTQIDI(x) ((DI) (QI) (x))
|
||||
#endif
|
||||
#define EXTHIHI(x) ((HI) (HI) (x))
|
||||
#define EXTHISI(x) ((SI) (HI) (x))
|
||||
#define EXTSISI(x) ((SI) (SI) (x))
|
||||
#if defined (DI_FN_SUPPORT)
|
||||
extern DI EXTHIDI (HI);
|
||||
#else
|
||||
#define EXTHIDI(x) ((DI) (HI) (x))
|
||||
#endif
|
||||
#if defined (DI_FN_SUPPORT)
|
||||
extern DI EXTSIDI (SI);
|
||||
#else
|
||||
#define EXTSIDI(x) ((DI) (SI) (x))
|
||||
#endif
|
||||
|
||||
#define ZEXTBIQI(x) ((QI) (BI) (x))
|
||||
#define ZEXTBIHI(x) ((HI) (BI) (x))
|
||||
#define ZEXTBISI(x) ((SI) (BI) (x))
|
||||
#if defined (DI_FN_SUPPORT)
|
||||
extern DI ZEXTBIDI (BI);
|
||||
#else
|
||||
#define ZEXTBIDI(x) ((DI) (BI) (x))
|
||||
#endif
|
||||
#define ZEXTQIHI(x) ((HI) (UQI) (x))
|
||||
#define ZEXTQISI(x) ((SI) (UQI) (x))
|
||||
#if defined (DI_FN_SUPPORT)
|
||||
extern DI ZEXTQIDI (QI);
|
||||
#else
|
||||
#define ZEXTQIDI(x) ((DI) (UQI) (x))
|
||||
#endif
|
||||
#define ZEXTHISI(x) ((SI) (UHI) (x))
|
||||
#define ZEXTHIHI(x) ((HI) (UHI) (x))
|
||||
#define ZEXTSISI(x) ((SI) (USI) (x))
|
||||
#if defined (DI_FN_SUPPORT)
|
||||
extern DI ZEXTHIDI (HI);
|
||||
#else
|
||||
#define ZEXTHIDI(x) ((DI) (UHI) (x))
|
||||
#endif
|
||||
#if defined (DI_FN_SUPPORT)
|
||||
extern DI ZEXTSIDI (SI);
|
||||
#else
|
||||
#define ZEXTSIDI(x) ((DI) (USI) (x))
|
||||
#endif
|
||||
|
||||
#define TRUNCQIBI(x) ((BI) (QI) (x))
|
||||
#define TRUNCHIBI(x) ((BI) (HI) (x))
|
||||
#define TRUNCHIQI(x) ((QI) (HI) (x))
|
||||
#define TRUNCSIBI(x) ((BI) (SI) (x))
|
||||
#define TRUNCSIQI(x) ((QI) (SI) (x))
|
||||
#define TRUNCSIHI(x) ((HI) (SI) (x))
|
||||
#define TRUNCSISI(x) ((SI) (SI) (x))
|
||||
#if defined (DI_FN_SUPPORT)
|
||||
extern BI TRUNCDIBI (DI);
|
||||
#else
|
||||
#define TRUNCDIBI(x) ((BI) (DI) (x))
|
||||
#endif
|
||||
#if defined (DI_FN_SUPPORT)
|
||||
extern QI TRUNCDIQI (DI);
|
||||
#else
|
||||
#define TRUNCDIQI(x) ((QI) (DI) (x))
|
||||
#endif
|
||||
#if defined (DI_FN_SUPPORT)
|
||||
extern HI TRUNCDIHI (DI);
|
||||
#else
|
||||
#define TRUNCDIHI(x) ((HI) (DI) (x))
|
||||
#endif
|
||||
#if defined (DI_FN_SUPPORT)
|
||||
extern SI TRUNCDISI (DI);
|
||||
#else
|
||||
#define TRUNCDISI(x) ((SI) (DI) (x))
|
||||
#endif
|
||||
|
||||
/* Composing/decomposing the various types.
|
||||
Word ordering is endian-independent. Words are specified most to least
|
||||
significant and word number 0 is the most significant word.
|
||||
??? May also wish an endian-dependent version. Later. */
|
||||
|
||||
QI SUBWORDSIQI (SI, int);
|
||||
HI SUBWORDSIHI (SI, int);
|
||||
QI SUBWORDDIQI (DI, int);
|
||||
HI SUBWORDDIHI (DI, int);
|
||||
SI SUBWORDDISI (DI, int);
|
||||
|
||||
#ifdef SEMOPS_DEFINE_INLINE
|
||||
|
||||
SEMOPS_INLINE QI
|
||||
SUBWORDSIQI (SI in, int byte)
|
||||
{
|
||||
assert (byte >= 0 && byte <= 3);
|
||||
return (UQI) (in >> (8 * (3 - byte))) & 0xFF;
|
||||
}
|
||||
|
||||
SEMOPS_INLINE HI
|
||||
SUBWORDSIHI (SI in, int word)
|
||||
{
|
||||
if (word == 0)
|
||||
return (USI) in >> 16;
|
||||
else
|
||||
return in;
|
||||
}
|
||||
|
||||
SEMOPS_INLINE QI
|
||||
SUBWORDDIQI (DI in, int byte)
|
||||
{
|
||||
assert (byte >= 0 && byte <= 7);
|
||||
return (UQI) (in >> (8 * (7 - byte))) & 0xFF;
|
||||
}
|
||||
|
||||
SEMOPS_INLINE HI
|
||||
SUBWORDDIHI (DI in, int word)
|
||||
{
|
||||
assert (word >= 0 && word <= 3);
|
||||
return (UHI) (in >> (16 * (3 - word))) & 0xFFFF;
|
||||
}
|
||||
|
||||
SEMOPS_INLINE SI
|
||||
SUBWORDDISI (DI in, int word)
|
||||
{
|
||||
if (word == 0)
|
||||
return (UDI) in >> 32;
|
||||
else
|
||||
return in;
|
||||
}
|
||||
|
||||
#endif /* SUBWORD,JOIN */
|
||||
|
||||
#endif /* CGEN_BASIC_OPS_H */
|
|
@ -0,0 +1,56 @@
|
|||
/* Header file the type CGEN_BITSET.
|
||||
Copyright 2002, 2005, 2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU opcodes library.
|
||||
|
||||
This library 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
It 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 library; see the file COPYING3. If not, write to the
|
||||
Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef CGEN_BITSET_H
|
||||
#define CGEN_BITSET_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* A bitmask represented as a string.
|
||||
Each member of the set is represented as a bit
|
||||
in the string. Bytes are indexed from left to right in the string and
|
||||
bits from most significant to least within each byte.
|
||||
|
||||
For example, the bit representing member number 6 is (set->bits[0] & 0x02).
|
||||
*/
|
||||
typedef struct cgen_bitset
|
||||
{
|
||||
unsigned length;
|
||||
char *bits;
|
||||
} CGEN_BITSET;
|
||||
|
||||
extern CGEN_BITSET *cgen_bitset_create PARAMS ((unsigned));
|
||||
extern void cgen_bitset_init PARAMS ((CGEN_BITSET *, unsigned));
|
||||
extern void cgen_bitset_clear PARAMS ((CGEN_BITSET *));
|
||||
extern void cgen_bitset_add PARAMS ((CGEN_BITSET *, unsigned));
|
||||
extern void cgen_bitset_set PARAMS ((CGEN_BITSET *, unsigned));
|
||||
extern int cgen_bitset_compare PARAMS ((CGEN_BITSET *, CGEN_BITSET *));
|
||||
extern void cgen_bitset_union PARAMS ((CGEN_BITSET *, CGEN_BITSET *, CGEN_BITSET *));
|
||||
extern int cgen_bitset_intersect_p PARAMS ((CGEN_BITSET *, CGEN_BITSET *));
|
||||
extern int cgen_bitset_contains PARAMS ((CGEN_BITSET *, unsigned));
|
||||
extern CGEN_BITSET *cgen_bitset_copy PARAMS ((CGEN_BITSET *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,317 @@
|
|||
2011-03-31 Tristan Gingold <gingold@adacore.com>
|
||||
|
||||
* internal.h (C_NULL_VALUE): Define.
|
||||
|
||||
2010-06-29 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* maxq.h: Delete file.
|
||||
|
||||
2010-04-15 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* alpha.h: Update copyright notice to use GPLv3.
|
||||
* apollo.h: Likewise.
|
||||
* arm.h: Likewise.
|
||||
* aux-coff.h: Likewise.
|
||||
* ecoff.h: Likewise.
|
||||
* external.h: Likewise.
|
||||
* go32exe.h: Likewise.
|
||||
* h8300.h: Likewise.
|
||||
* h8500.h: Likewise.
|
||||
* i386.h: Likewise.
|
||||
* i860.h: Likewise.
|
||||
* i960.h: Likewise.
|
||||
* ia64.h: Likewise.
|
||||
* internal.h: Likewise.
|
||||
* m68k.h: Likewise.
|
||||
* m88k.h: Likewise.
|
||||
* maxq.h: Likewise.
|
||||
* mcore.h: Likewise.
|
||||
* mips.h: Likewise.
|
||||
* mipspe.h: Likewise.
|
||||
* or32.h: Likewise.
|
||||
* pe.h: Likewise.
|
||||
* powerpc.h: Likewise.
|
||||
* rs6000.h: Likewise.
|
||||
* rs6k64.h: Likewise.
|
||||
* sh.h: Likewise.
|
||||
* sparc.h: Likewise.
|
||||
* ti.h: Likewise.
|
||||
* tic30.h: Likewise.
|
||||
* tic4x.h: Likewise.
|
||||
* tic54x.h: Likewise.
|
||||
* tic80.h: Likewise.
|
||||
* w65.h: Likewise.
|
||||
* we32k.h: Likewise.
|
||||
* x86_64.h: Likewise.
|
||||
* xcoff.h: Likewise.
|
||||
* z80.h: Likewise.
|
||||
* z8k.h: Likewise.
|
||||
|
||||
2009-12-02 Jerker Bäck <jerker.back@gmail.com>
|
||||
|
||||
PR binutils/11017
|
||||
* i386lh (COFF_PAGE_SIZE): Define.
|
||||
* x86_64.h (COFF_PAGE_SIZE): Define.
|
||||
|
||||
2009-10-17 Arnold Metselaar <arnold.metselaar@planet.nl>
|
||||
|
||||
* z80.h: Store alignment requirement in section header, to allow
|
||||
ld to preserve alignment. Some code was copied from ti.h.
|
||||
|
||||
2009-09-05 Martin Thuresson <martin@mtme.org>
|
||||
|
||||
* ti.h (GET_LNSZ_SIZE, PUT_LNSZ_SIZE): Updated name of class
|
||||
variable to in_class to match changes in function that use this
|
||||
macro.
|
||||
|
||||
2009-08-10 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Fix references past allocated memory for i386-*-go32.
|
||||
* ti.h (COFF_ADJUST_FILEHDR_IN_POST, COFF_ADJUST_FILEHDR_OUT_POST):
|
||||
Reference F_TARGET_ID only when !COFF0_P.
|
||||
|
||||
2009-08-10 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Stop using bfd_usrdata in libbfd.
|
||||
* go32exe.h (struct external_filehdr_go32_exe <stub>, FILHSZ): Replace
|
||||
STUBSIZE by GO32_STUBSIZE.
|
||||
(STUBSIZE): Move the definition ...
|
||||
* internal.h (GO32_STUBSIZE): ... here and rename it.
|
||||
(struct internal_filehdr <go32stub>, F_GO32STUB): New.
|
||||
|
||||
2009-06-03 Ulrich Weigand <uweigand@de.ibm.com>
|
||||
|
||||
* symconst.h (btLong64, btULong64, btLongLong64, btULongLong64,
|
||||
btAdr64, btInt64, btUInt64): New defines.
|
||||
|
||||
2009-04-21 Kai Tietz <kai.tietz@onevision.com>
|
||||
|
||||
* pe.h (pex64_runtime_function): New structure.
|
||||
(external_pex64_runtime_function): Likewise.
|
||||
(pex64_unwind_code): Likewise.
|
||||
(external_pex64_unwind_code): Likewise.
|
||||
(pex64_unwind_info): Likewise.
|
||||
(external_pex64_unwind_info): Likewise.
|
||||
(external_pex64_scope): Likewise.
|
||||
(pex64_scope): Likewise.
|
||||
(pex64_scope_entry): Likewise.
|
||||
(external_pex64_scope_entry): Likewise.
|
||||
(PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro.
|
||||
(PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise.
|
||||
(PEX64_UNWCODE_CODE): Likewise.
|
||||
(PEX64_UNWCODE_INFO): Likewise.
|
||||
(UWOP_...): Add defines for unwind code.
|
||||
(UNW_FLAG_...): Add defined for unwind info flags.
|
||||
(PEX64_SCOPE_ENTRY_SIZE): New macro.
|
||||
(PEX64_UWI_VERSION): Likewise.
|
||||
(PEX64_UWI_FLAGS): Likewise.
|
||||
(PEX64_UWI_FRAMEREG): Likewise.
|
||||
(PEX64_UWI_FRAMEOFF): Likewise.
|
||||
(PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise.
|
||||
(PEX64_OFFSET_TO_UNWIND_CODE): Likewise.
|
||||
(PEX64_OFFSET_TO_HANDLER_RVA): Likewise.
|
||||
(PEX64_OFFSET_TO_SCOPE_COUNT): Likewise.
|
||||
(PEX64_SCOPE_ENTRY): Likewise.
|
||||
|
||||
2009-04-17 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* pe.h (IMAGE_SUBSYSTEM_EFI_ROM): Renamed to ...
|
||||
(IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER): This.
|
||||
|
||||
2009-04-01 Richard Sandiford <r.sandiford@uk.ibm.com>
|
||||
|
||||
* xcoff.h (xcoff_link_hash_table): Move to bfd/xcofflink.c.
|
||||
|
||||
2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
|
||||
|
||||
* xcoff.h (XCOFF_EXPALL, XCOFF_EXPFULL): New flags.
|
||||
(xcoff_loader_info): Add auto_export_flags.
|
||||
|
||||
2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
|
||||
|
||||
* internal.h (C_AIX_WEAKEXT): New macro.
|
||||
(C_WEAKEXT): Use the GNU definition in the generic part of the file,
|
||||
and conditionally reset it to C_AIX_WEAKEXT in the XCOFF part of
|
||||
the file.
|
||||
(CSECT_SYM_P): New macro.
|
||||
* xcoff.h (L_WEAK): Define.
|
||||
(EXTERN_SYM_P): New macro.
|
||||
|
||||
2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
|
||||
|
||||
* xcoff.h (XCOFF_ALLOCATED): New flag.
|
||||
|
||||
2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
|
||||
|
||||
* xcoff.h (XCOFF_CALLED, XCOFF_IMPORT): Update comments.
|
||||
(XCOFF_WAS_UNDEFINED): New flag.
|
||||
(xcoff_link_hash_table): Add an "rtld" field.
|
||||
|
||||
2009-03-14 Dave Korn <dave.korn.cygwin@gmail.com>
|
||||
|
||||
* internal.h (struct internal_extra_pe_aouthdr): Correct type
|
||||
of DllCharacteristics flags field to unsigned.
|
||||
* pe.h (IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE,
|
||||
IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE,
|
||||
IMAGE_DLL_CHARACTERISTICS_NX_COMPAT,
|
||||
IMAGE_DLLCHARACTERISTICS_NO_ISOLATION,
|
||||
IMAGE_DLLCHARACTERISTICS_NO_SEH,
|
||||
IMAGE_DLLCHARACTERISTICS_NO_BIND,
|
||||
IMAGE_DLLCHARACTERISTICS_WDM_DRIVER,
|
||||
IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE): New macros to
|
||||
define flag bit values for DllCharacteristics field of PEAOUTHDR,
|
||||
PEPAOUTHDR.
|
||||
|
||||
2008-12-23 Johan Olmutz Nielsen <jnielsen@ddci.com>
|
||||
|
||||
* ti.h (COFF_ADJUST_SCNHDR_OUT_PRE): Define.
|
||||
|
||||
2008-06-17 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* ti.h (GET_SCNHDR_NLNNO): Provide an alternative version of this
|
||||
macro which does not trigger an array bounds warning in gcc.
|
||||
(PUT_SCNHDR_NLNNO): Likewise.
|
||||
(GET_SCNHDR_FLAGS): Likewise.
|
||||
(PUT_SCNHDR_FLAGS): Likewise.
|
||||
(GET_SCNHDR_PAGE): Likewise.
|
||||
(PUT_SCNHDR_PAGE): Likewise.
|
||||
|
||||
2007-11-05 Danny Smith <dannysmith@users.sourceforge.net>
|
||||
|
||||
* pe.h (COFF_ENCODE_ALIGNMENT) Define.
|
||||
|
||||
2007-08-02 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* pe.h (IMAGE_SCN_ALIGN_POWER_BIT_POS): New.
|
||||
(IMAGE_SCN_ALIGN_POWER_BIT_MASK): Likewise.
|
||||
(IMAGE_SCN_ALIGN_POWER_NUM): Likewise.
|
||||
(IMAGE_SCN_ALIGN_POWER_CONST): Likewise.
|
||||
(IMAGE_SCN_ALIGN_128BYTES): Likewise.
|
||||
(IMAGE_SCN_ALIGN_256BYTES): Likewise.
|
||||
(IMAGE_SCN_ALIGN_512BYTES): Likewise.
|
||||
(IMAGE_SCN_ALIGN_1024BYTES): Likewise.
|
||||
(IMAGE_SCN_ALIGN_2048BYTES): Likewise.
|
||||
(IMAGE_SCN_ALIGN_4096BYTES): Likewise.
|
||||
(IMAGE_SCN_ALIGN_8192BYTES): Likewise.
|
||||
(IMAGE_SCN_ALIGN_1BYTES): Redefined with
|
||||
IMAGE_SCN_ALIGN_POWER_CONST.
|
||||
(IMAGE_SCN_ALIGN_2BYTES): Likewise.
|
||||
(IMAGE_SCN_ALIGN_4BYTES): Likewise.
|
||||
(IMAGE_SCN_ALIGN_8BYTES): Likewise.
|
||||
(IMAGE_SCN_ALIGN_16BYTES): Likewise.
|
||||
(IMAGE_SCN_ALIGN_32BYTES): Likewise.
|
||||
(IMAGE_SCN_ALIGN_64BYTES): Likewise.
|
||||
|
||||
2007-07-12 Kai Tietz <kai.tietz@onevision.com>
|
||||
|
||||
* internal.h (struct internal_syment): Use bfd_hostptr_t for
|
||||
_n_zeroes and _n_offset fields.
|
||||
|
||||
2007-04-27 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* rs6000.h: Write Mimi's name in ASCII.
|
||||
|
||||
2007-03-19 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* internal.h (internal_extra_pe_aouthdr): Add Magic,
|
||||
MajorLinkerVersion, MinorLinkerVersion, SizeOfCode,
|
||||
SizeOfInitializedData, SizeOfUninitializedData,
|
||||
AddressOfEntryPoint, BaseOfCode and BaseOfData.
|
||||
|
||||
2006-12-05 Michael Tautschnig <tautschn@model.in.tum.de>
|
||||
Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* external.h (struct external_aouthdr): Add ATTRIBUTE_PACKED.
|
||||
(struct external_syment): Likewise.
|
||||
(union external_auxent): Likewise.
|
||||
|
||||
2006-11-14 Phil Lello <phil.lello@homecall.co.uk>
|
||||
|
||||
* pe.h: Added defines for IMAGE_SUBSYSTEM_EFI_ROM and
|
||||
IMAGE_SUBSYSTEM_XBOX.
|
||||
* internal.h: Added defines for PE directory entry types.
|
||||
NB: in internal.h because IMAGE_NUMBEROF_DIRECTORY_ENTRYIES is in
|
||||
pe.h
|
||||
|
||||
2006-09-20 Kai Tietz <Kai.Tietz@onevision.com>
|
||||
|
||||
* external.h: Add proper external_aouthdr64 structure (without
|
||||
data_start member).
|
||||
(AOUTHDRSZ64): Set according structure size.
|
||||
(AOUTHDR64): As typedef of external_aouthdr64 structure.
|
||||
* internal.h: Add relocation identifiers for coff.
|
||||
* pe.h: Add define IMAGE_FILE_MACHINE_AMD64 the coff signature.
|
||||
(PEPAOUTHDR): Adjust structure to have proper size (using AOUTHDR64).
|
||||
(PEPAOUTSZ): Calculated size of 240.
|
||||
* x86_64.h: Coff information for x86_64 (AMD64).
|
||||
|
||||
2006-02-05 Arnold Metselaar <arnold.metselaar@planet.nl>
|
||||
|
||||
* internal.h: Add relocation number R_IMM24 for Z80.
|
||||
|
||||
2005-10-25 Arnold Metselaar <arnold.metselaar@planet.nl>
|
||||
|
||||
* internal.h: Add relocation number for Z80
|
||||
* z80.h: New file.
|
||||
|
||||
2005-08-18 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* a29k.h: Delete.
|
||||
|
||||
2005-07-14 Daniel Marques <marques@cs.cornell.edu>
|
||||
|
||||
* alpha.h (ALPHA_ECOFF_COMPRESSEDMAG): Define.
|
||||
* ecoff.h (ALPHA_MAGIC_COMPRESSED): Define.
|
||||
|
||||
2005-05-10 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* Update the address and phone number of the FSF organization in
|
||||
the GPL notices in the following files:
|
||||
a29k.h, alpha.h, apollo.h, arm.h, aux-coff.h, ecoff.h, external.h,
|
||||
go32exe.h, h8300.h, h8500.h, i386.h, i860.h, i960.h, ia64.h,
|
||||
internal.h, m68k.h, m88k.h, maxq.h, mcore.h, mips.h, mipspe.h,
|
||||
or32.h, pe.h, powerpc.h, rs6k64.h, sh.h, sparc.h, ti.h, tic30.h,
|
||||
tic4x.h, tic54x.h, tic80.h, w65.h, we32k.h, xcoff.h, z8k.h
|
||||
|
||||
2005-02-21 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* xcoff.h (struct xcoff_loader_info): Warning fix.
|
||||
|
||||
2005-01-10 Inderpreet Singh <inderpreetb@noida.hcltech.com>
|
||||
|
||||
* maxq.h (F_MAXQ10, F_MAXQ20): Define.
|
||||
|
||||
2004-11-08 Inderpreet Singh <inderpreetb@nioda.hcltech.com>
|
||||
Vineet Sharma <vineets@noida.hcltech.com>
|
||||
|
||||
* maxq.h: New file: Defintions for the maxq port.
|
||||
|
||||
2004-11-08 Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
|
||||
|
||||
* pe.h (IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY): Define.
|
||||
(IMAGE_WEAK_EXTERN_SEARCH_LIBRARY): Same.
|
||||
(IMAGE_WEAK_EXTERN_SEARCH_ALIAS): Same.
|
||||
|
||||
2004-08-13 Mark Kettenis <kettenis@gnu.org>
|
||||
|
||||
* symconst.h (langMax): Fix typo in comment.
|
||||
|
||||
2004-04-23 Chris Demetriou <cgd@broadcom.com>
|
||||
|
||||
* mips.h (MIPS_R_RELHI, MIPS_R_RELLO, MIPS_R_SWITCH): Remove
|
||||
(MIPS_R_PCREL16): Update comment.
|
||||
* ecoff.h (struct ecoff_value_adjust): Remove structure.
|
||||
(struct ecoff_debug_info): Remove 'adjust' member.
|
||||
|
||||
2004-04-20 DJ Delorie <dj@redhat.com>
|
||||
|
||||
* internal.h (R_SECREL32): Add.
|
||||
|
||||
For older changes see ChangeLog-9103
|
||||
|
||||
Local Variables:
|
||||
mode: change-log
|
||||
left-margin: 8
|
||||
fill-column: 74
|
||||
version-control: never
|
||||
End:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,386 @@
|
|||
/* ECOFF support on Alpha machines.
|
||||
coff/ecoff.h must be included before this file.
|
||||
|
||||
Copyright 2001, 2005, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/********************** FILE HEADER **********************/
|
||||
|
||||
struct external_filehdr
|
||||
{
|
||||
unsigned char f_magic[2]; /* magic number */
|
||||
unsigned char f_nscns[2]; /* number of sections */
|
||||
unsigned char f_timdat[4]; /* time & date stamp */
|
||||
unsigned char f_symptr[8]; /* file pointer to symtab */
|
||||
unsigned char f_nsyms[4]; /* number of symtab entries */
|
||||
unsigned char f_opthdr[2]; /* sizeof(optional hdr) */
|
||||
unsigned char f_flags[2]; /* flags */
|
||||
};
|
||||
|
||||
/* Magic numbers are defined in coff/ecoff.h. */
|
||||
#define ALPHA_ECOFF_BADMAG(x) \
|
||||
((x).f_magic != ALPHA_MAGIC && (x).f_magic != ALPHA_MAGIC_BSD)
|
||||
|
||||
#define ALPHA_ECOFF_COMPRESSEDMAG(x) \
|
||||
((x).f_magic == ALPHA_MAGIC_COMPRESSED)
|
||||
|
||||
/* The object type is encoded in the f_flags. */
|
||||
#define F_ALPHA_OBJECT_TYPE_MASK 0x3000
|
||||
#define F_ALPHA_NO_SHARED 0x1000
|
||||
#define F_ALPHA_SHARABLE 0x2000
|
||||
#define F_ALPHA_CALL_SHARED 0x3000
|
||||
|
||||
#define FILHDR struct external_filehdr
|
||||
#define FILHSZ 24
|
||||
|
||||
/********************** AOUT "OPTIONAL HEADER" **********************/
|
||||
|
||||
typedef struct external_aouthdr
|
||||
{
|
||||
unsigned char magic[2]; /* type of file */
|
||||
unsigned char vstamp[2]; /* version stamp */
|
||||
unsigned char bldrev[2]; /* ?? */
|
||||
unsigned char padding[2]; /* pad to quadword boundary */
|
||||
unsigned char tsize[8]; /* text size in bytes */
|
||||
unsigned char dsize[8]; /* initialized data " " */
|
||||
unsigned char bsize[8]; /* uninitialized data " " */
|
||||
unsigned char entry[8]; /* entry pt. */
|
||||
unsigned char text_start[8]; /* base of text used for this file */
|
||||
unsigned char data_start[8]; /* base of data used for this file */
|
||||
unsigned char bss_start[8]; /* base of bss used for this file */
|
||||
unsigned char gprmask[4]; /* bitmask of general registers used */
|
||||
unsigned char fprmask[4]; /* bitmask of floating point registers used */
|
||||
unsigned char gp_value[8]; /* value for gp register */
|
||||
} AOUTHDR;
|
||||
|
||||
/* compute size of a header */
|
||||
|
||||
#define AOUTSZ 80
|
||||
#define AOUTHDRSZ 80
|
||||
|
||||
/********************** SECTION HEADER **********************/
|
||||
|
||||
struct external_scnhdr
|
||||
{
|
||||
unsigned char s_name[8]; /* section name */
|
||||
unsigned char s_paddr[8]; /* physical address, aliased s_nlib */
|
||||
unsigned char s_vaddr[8]; /* virtual address */
|
||||
unsigned char s_size[8]; /* section size */
|
||||
unsigned char s_scnptr[8]; /* file ptr to raw data for section */
|
||||
unsigned char s_relptr[8]; /* file ptr to relocation */
|
||||
unsigned char s_lnnoptr[8]; /* file ptr to line numbers */
|
||||
unsigned char s_nreloc[2]; /* number of relocation entries */
|
||||
unsigned char s_nlnno[2]; /* number of line number entries*/
|
||||
unsigned char s_flags[4]; /* flags */
|
||||
};
|
||||
|
||||
#define SCNHDR struct external_scnhdr
|
||||
#define SCNHSZ 64
|
||||
|
||||
/********************** RELOCATION DIRECTIVES **********************/
|
||||
|
||||
struct external_reloc
|
||||
{
|
||||
unsigned char r_vaddr[8];
|
||||
unsigned char r_symndx[4];
|
||||
unsigned char r_bits[4];
|
||||
};
|
||||
|
||||
#define RELOC struct external_reloc
|
||||
#define RELSZ 16
|
||||
|
||||
/* Constants to unpack the r_bits field. The Alpha seems to always be
|
||||
little endian, so I haven't bothered to define big endian variants
|
||||
of these. */
|
||||
|
||||
#define RELOC_BITS0_TYPE_LITTLE 0xff
|
||||
#define RELOC_BITS0_TYPE_SH_LITTLE 0
|
||||
|
||||
#define RELOC_BITS1_EXTERN_LITTLE 0x01
|
||||
|
||||
#define RELOC_BITS1_OFFSET_LITTLE 0x7e
|
||||
#define RELOC_BITS1_OFFSET_SH_LITTLE 1
|
||||
|
||||
#define RELOC_BITS1_RESERVED_LITTLE 0x80
|
||||
#define RELOC_BITS1_RESERVED_SH_LITTLE 7
|
||||
#define RELOC_BITS2_RESERVED_LITTLE 0xff
|
||||
#define RELOC_BITS2_RESERVED_SH_LEFT_LITTLE 1
|
||||
#define RELOC_BITS3_RESERVED_LITTLE 0x03
|
||||
#define RELOC_BITS3_RESERVED_SH_LEFT_LITTLE 9
|
||||
|
||||
#define RELOC_BITS3_SIZE_LITTLE 0xfc
|
||||
#define RELOC_BITS3_SIZE_SH_LITTLE 2
|
||||
|
||||
/* The r_type field in a reloc is one of the following values. */
|
||||
#define ALPHA_R_IGNORE 0
|
||||
#define ALPHA_R_REFLONG 1
|
||||
#define ALPHA_R_REFQUAD 2
|
||||
#define ALPHA_R_GPREL32 3
|
||||
#define ALPHA_R_LITERAL 4
|
||||
#define ALPHA_R_LITUSE 5
|
||||
#define ALPHA_R_GPDISP 6
|
||||
#define ALPHA_R_BRADDR 7
|
||||
#define ALPHA_R_HINT 8
|
||||
#define ALPHA_R_SREL16 9
|
||||
#define ALPHA_R_SREL32 10
|
||||
#define ALPHA_R_SREL64 11
|
||||
#define ALPHA_R_OP_PUSH 12
|
||||
#define ALPHA_R_OP_STORE 13
|
||||
#define ALPHA_R_OP_PSUB 14
|
||||
#define ALPHA_R_OP_PRSHIFT 15
|
||||
#define ALPHA_R_GPVALUE 16
|
||||
#define ALPHA_R_GPRELHIGH 17
|
||||
#define ALPHA_R_GPRELLOW 18
|
||||
#define ALPHA_R_IMMED 19
|
||||
|
||||
/* Overloaded reloc value used by Net- and OpenBSD. */
|
||||
#define ALPHA_R_LITERALSLEAZY 17
|
||||
|
||||
/* With ALPHA_R_LITUSE, the r_size field is one of the following values. */
|
||||
#define ALPHA_R_LU_BASE 1
|
||||
#define ALPHA_R_LU_BYTOFF 2
|
||||
#define ALPHA_R_LU_JSR 3
|
||||
|
||||
/* With ALPHA_R_IMMED, the r_size field is one of the following values. */
|
||||
#define ALPHA_R_IMMED_GP_16 1
|
||||
#define ALPHA_R_IMMED_GP_HI32 2
|
||||
#define ALPHA_R_IMMED_SCN_HI32 3
|
||||
#define ALPHA_R_IMMED_BR_HI32 4
|
||||
#define ALPHA_R_IMMED_LO32 5
|
||||
|
||||
/********************** SYMBOLIC INFORMATION **********************/
|
||||
|
||||
/* Written by John Gilmore. */
|
||||
|
||||
/* ECOFF uses COFF-like section structures, but its own symbol format.
|
||||
This file defines the symbol format in fields whose size and alignment
|
||||
will not vary on different host systems. */
|
||||
|
||||
/* File header as a set of bytes */
|
||||
|
||||
struct hdr_ext
|
||||
{
|
||||
unsigned char h_magic[2];
|
||||
unsigned char h_vstamp[2];
|
||||
unsigned char h_ilineMax[4];
|
||||
unsigned char h_idnMax[4];
|
||||
unsigned char h_ipdMax[4];
|
||||
unsigned char h_isymMax[4];
|
||||
unsigned char h_ioptMax[4];
|
||||
unsigned char h_iauxMax[4];
|
||||
unsigned char h_issMax[4];
|
||||
unsigned char h_issExtMax[4];
|
||||
unsigned char h_ifdMax[4];
|
||||
unsigned char h_crfd[4];
|
||||
unsigned char h_iextMax[4];
|
||||
unsigned char h_cbLine[8];
|
||||
unsigned char h_cbLineOffset[8];
|
||||
unsigned char h_cbDnOffset[8];
|
||||
unsigned char h_cbPdOffset[8];
|
||||
unsigned char h_cbSymOffset[8];
|
||||
unsigned char h_cbOptOffset[8];
|
||||
unsigned char h_cbAuxOffset[8];
|
||||
unsigned char h_cbSsOffset[8];
|
||||
unsigned char h_cbSsExtOffset[8];
|
||||
unsigned char h_cbFdOffset[8];
|
||||
unsigned char h_cbRfdOffset[8];
|
||||
unsigned char h_cbExtOffset[8];
|
||||
};
|
||||
|
||||
/* File descriptor external record */
|
||||
|
||||
struct fdr_ext
|
||||
{
|
||||
unsigned char f_adr[8];
|
||||
unsigned char f_cbLineOffset[8];
|
||||
unsigned char f_cbLine[8];
|
||||
unsigned char f_cbSs[8];
|
||||
unsigned char f_rss[4];
|
||||
unsigned char f_issBase[4];
|
||||
unsigned char f_isymBase[4];
|
||||
unsigned char f_csym[4];
|
||||
unsigned char f_ilineBase[4];
|
||||
unsigned char f_cline[4];
|
||||
unsigned char f_ioptBase[4];
|
||||
unsigned char f_copt[4];
|
||||
unsigned char f_ipdFirst[4];
|
||||
unsigned char f_cpd[4];
|
||||
unsigned char f_iauxBase[4];
|
||||
unsigned char f_caux[4];
|
||||
unsigned char f_rfdBase[4];
|
||||
unsigned char f_crfd[4];
|
||||
unsigned char f_bits1[1];
|
||||
unsigned char f_bits2[3];
|
||||
unsigned char f_padding[4];
|
||||
};
|
||||
|
||||
#define FDR_BITS1_LANG_BIG 0xF8
|
||||
#define FDR_BITS1_LANG_SH_BIG 3
|
||||
#define FDR_BITS1_LANG_LITTLE 0x1F
|
||||
#define FDR_BITS1_LANG_SH_LITTLE 0
|
||||
|
||||
#define FDR_BITS1_FMERGE_BIG 0x04
|
||||
#define FDR_BITS1_FMERGE_LITTLE 0x20
|
||||
|
||||
#define FDR_BITS1_FREADIN_BIG 0x02
|
||||
#define FDR_BITS1_FREADIN_LITTLE 0x40
|
||||
|
||||
#define FDR_BITS1_FBIGENDIAN_BIG 0x01
|
||||
#define FDR_BITS1_FBIGENDIAN_LITTLE 0x80
|
||||
|
||||
#define FDR_BITS2_GLEVEL_BIG 0xC0
|
||||
#define FDR_BITS2_GLEVEL_SH_BIG 6
|
||||
#define FDR_BITS2_GLEVEL_LITTLE 0x03
|
||||
#define FDR_BITS2_GLEVEL_SH_LITTLE 0
|
||||
|
||||
/* We ignore the `reserved' field in bits2. */
|
||||
|
||||
/* Procedure descriptor external record */
|
||||
|
||||
struct pdr_ext {
|
||||
unsigned char p_adr[8];
|
||||
unsigned char p_cbLineOffset[8];
|
||||
unsigned char p_isym[4];
|
||||
unsigned char p_iline[4];
|
||||
unsigned char p_regmask[4];
|
||||
unsigned char p_regoffset[4];
|
||||
unsigned char p_iopt[4];
|
||||
unsigned char p_fregmask[4];
|
||||
unsigned char p_fregoffset[4];
|
||||
unsigned char p_frameoffset[4];
|
||||
unsigned char p_lnLow[4];
|
||||
unsigned char p_lnHigh[4];
|
||||
unsigned char p_gp_prologue[1];
|
||||
unsigned char p_bits1[1];
|
||||
unsigned char p_bits2[1];
|
||||
unsigned char p_localoff[1];
|
||||
unsigned char p_framereg[2];
|
||||
unsigned char p_pcreg[2];
|
||||
};
|
||||
|
||||
#define PDR_BITS1_GP_USED_BIG 0x80
|
||||
#define PDR_BITS1_REG_FRAME_BIG 0x40
|
||||
#define PDR_BITS1_PROF_BIG 0x20
|
||||
#define PDR_BITS1_RESERVED_BIG 0x1f
|
||||
#define PDR_BITS1_RESERVED_SH_LEFT_BIG 8
|
||||
#define PDR_BITS2_RESERVED_BIG 0xff
|
||||
#define PDR_BITS2_RESERVED_SH_BIG 0
|
||||
|
||||
#define PDR_BITS1_GP_USED_LITTLE 0x01
|
||||
#define PDR_BITS1_REG_FRAME_LITTLE 0x02
|
||||
#define PDR_BITS1_PROF_LITTLE 0x04
|
||||
#define PDR_BITS1_RESERVED_LITTLE 0xf8
|
||||
#define PDR_BITS1_RESERVED_SH_LITTLE 3
|
||||
#define PDR_BITS2_RESERVED_LITTLE 0xff
|
||||
#define PDR_BITS2_RESERVED_SH_LEFT_LITTLE 5
|
||||
|
||||
/* Line numbers */
|
||||
|
||||
struct line_ext {
|
||||
unsigned char l_line[4];
|
||||
};
|
||||
|
||||
/* Symbol external record */
|
||||
|
||||
struct sym_ext {
|
||||
unsigned char s_value[8];
|
||||
unsigned char s_iss[4];
|
||||
unsigned char s_bits1[1];
|
||||
unsigned char s_bits2[1];
|
||||
unsigned char s_bits3[1];
|
||||
unsigned char s_bits4[1];
|
||||
};
|
||||
|
||||
#define SYM_BITS1_ST_BIG 0xFC
|
||||
#define SYM_BITS1_ST_SH_BIG 2
|
||||
#define SYM_BITS1_ST_LITTLE 0x3F
|
||||
#define SYM_BITS1_ST_SH_LITTLE 0
|
||||
|
||||
#define SYM_BITS1_SC_BIG 0x03
|
||||
#define SYM_BITS1_SC_SH_LEFT_BIG 3
|
||||
#define SYM_BITS1_SC_LITTLE 0xC0
|
||||
#define SYM_BITS1_SC_SH_LITTLE 6
|
||||
|
||||
#define SYM_BITS2_SC_BIG 0xE0
|
||||
#define SYM_BITS2_SC_SH_BIG 5
|
||||
#define SYM_BITS2_SC_LITTLE 0x07
|
||||
#define SYM_BITS2_SC_SH_LEFT_LITTLE 2
|
||||
|
||||
#define SYM_BITS2_RESERVED_BIG 0x10
|
||||
#define SYM_BITS2_RESERVED_LITTLE 0x08
|
||||
|
||||
#define SYM_BITS2_INDEX_BIG 0x0F
|
||||
#define SYM_BITS2_INDEX_SH_LEFT_BIG 16
|
||||
#define SYM_BITS2_INDEX_LITTLE 0xF0
|
||||
#define SYM_BITS2_INDEX_SH_LITTLE 4
|
||||
|
||||
#define SYM_BITS3_INDEX_SH_LEFT_BIG 8
|
||||
#define SYM_BITS3_INDEX_SH_LEFT_LITTLE 4
|
||||
|
||||
#define SYM_BITS4_INDEX_SH_LEFT_BIG 0
|
||||
#define SYM_BITS4_INDEX_SH_LEFT_LITTLE 12
|
||||
|
||||
/* External symbol external record */
|
||||
|
||||
struct ext_ext {
|
||||
struct sym_ext es_asym;
|
||||
unsigned char es_bits1[1];
|
||||
unsigned char es_bits2[3];
|
||||
unsigned char es_ifd[4];
|
||||
};
|
||||
|
||||
#define EXT_BITS1_JMPTBL_BIG 0x80
|
||||
#define EXT_BITS1_JMPTBL_LITTLE 0x01
|
||||
|
||||
#define EXT_BITS1_COBOL_MAIN_BIG 0x40
|
||||
#define EXT_BITS1_COBOL_MAIN_LITTLE 0x02
|
||||
|
||||
#define EXT_BITS1_WEAKEXT_BIG 0x20
|
||||
#define EXT_BITS1_WEAKEXT_LITTLE 0x04
|
||||
|
||||
/* Dense numbers external record */
|
||||
|
||||
struct dnr_ext {
|
||||
unsigned char d_rfd[4];
|
||||
unsigned char d_index[4];
|
||||
};
|
||||
|
||||
/* Relative file descriptor */
|
||||
|
||||
struct rfd_ext {
|
||||
unsigned char rfd[4];
|
||||
};
|
||||
|
||||
/* Optimizer symbol external record */
|
||||
|
||||
struct opt_ext {
|
||||
unsigned char o_bits1[1];
|
||||
unsigned char o_bits2[1];
|
||||
unsigned char o_bits3[1];
|
||||
unsigned char o_bits4[1];
|
||||
struct rndx_ext o_rndx;
|
||||
unsigned char o_offset[4];
|
||||
};
|
||||
|
||||
#define OPT_BITS2_VALUE_SH_LEFT_BIG 16
|
||||
#define OPT_BITS2_VALUE_SH_LEFT_LITTLE 0
|
||||
|
||||
#define OPT_BITS3_VALUE_SH_LEFT_BIG 8
|
||||
#define OPT_BITS3_VALUE_SH_LEFT_LITTLE 8
|
||||
|
||||
#define OPT_BITS4_VALUE_SH_LEFT_BIG 0
|
||||
#define OPT_BITS4_VALUE_SH_LEFT_LITTLE 16
|
|
@ -0,0 +1,125 @@
|
|||
/* coff information for Apollo M68K
|
||||
|
||||
Copyright 2001, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#define DO_NOT_DEFINE_AOUTHDR
|
||||
#define L_LNNO_SIZE 2
|
||||
#include "coff/external.h"
|
||||
|
||||
/* Motorola 68000/68008/68010/68020 */
|
||||
#define MC68MAGIC 0520
|
||||
#define MC68KWRMAGIC 0520 /* writeable text segments */
|
||||
#define MC68TVMAGIC 0521
|
||||
#define MC68KROMAGIC 0521 /* readonly shareable text segments */
|
||||
#define MC68KPGMAGIC 0522 /* demand paged text segments */
|
||||
#define M68MAGIC 0210
|
||||
#define M68TVMAGIC 0211
|
||||
|
||||
/* Apollo 68000-based machines have a different magic number. This comes
|
||||
* from /usr/include/apollo/filehdr.h
|
||||
*/
|
||||
#define APOLLOM68KMAGIC 0627
|
||||
|
||||
#define OMAGIC M68MAGIC
|
||||
#define M68KBADMAG(x) (((x).f_magic!=MC68MAGIC) && ((x).f_magic!=MC68KWRMAGIC) && ((x).f_magic!=MC68TVMAGIC) && \
|
||||
((x).f_magic!=MC68KROMAGIC) && ((x).f_magic!=MC68KPGMAGIC) && ((x).f_magic!=M68MAGIC) && ((x).f_magic!=M68TVMAGIC) && \
|
||||
((x).f_magic!=APOLLOM68KMAGIC) )
|
||||
|
||||
/********************** AOUT "OPTIONAL HEADER" **********************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char magic[2]; /* type of file */
|
||||
char vstamp[2]; /* version stamp */
|
||||
char tsize[4]; /* text size in bytes, padded to FW bdry*/
|
||||
char dsize[4]; /* initialized data " " */
|
||||
char bsize[4]; /* uninitialized data " " */
|
||||
char entry[4]; /* entry pt. */
|
||||
char text_start[4]; /* base of text used for this file */
|
||||
char data_start[4]; /* base of data used for this file */
|
||||
char o_sri[4]; /* Apollo specific - .sri data pointer */
|
||||
char o_inlib[4]; /* Apollo specific - .inlib data pointer */
|
||||
char vid[8]; /* Apollo specific - 64 bit version ID */
|
||||
}
|
||||
AOUTHDR;
|
||||
|
||||
#define APOLLO_COFF_VERSION_NUMBER 1 /* the value of the aouthdr magic */
|
||||
#define AOUTHDRSZ 44
|
||||
#define AOUTSZ 44
|
||||
|
||||
/* Apollo allowa for larger section names by allowing
|
||||
them to be in the string table. */
|
||||
|
||||
/* If s_zeores is all zeroes, s_offset gives the real
|
||||
location of the name in the string table. */
|
||||
|
||||
#define s_zeroes section_name.s_name
|
||||
#define s_offset (section_name.s_name+4)
|
||||
|
||||
/* More names of "special" sections. */
|
||||
#define _TV ".tv"
|
||||
#define _INIT ".init"
|
||||
#define _FINI ".fini"
|
||||
#define _LINES ".lines"
|
||||
#define _BLOCKS ".blocks"
|
||||
#define _SRI ".sri" /* Static Resource Information (systype,
|
||||
et al.) */
|
||||
#define _MIR ".mir" /* Module Information Records */
|
||||
#define _APTV ".aptv" /* Apollo-style transfer vectors. */
|
||||
#define _INLIB ".inlib" /* Shared Library information */
|
||||
#define _RWDI ".rwdi" /* Read/write data initialization directives for
|
||||
compressed sections */
|
||||
#define _UNWIND ".unwind" /* Stack unwind information */
|
||||
|
||||
/********************** RELOCATION DIRECTIVES **********************/
|
||||
|
||||
struct external_reloc
|
||||
{
|
||||
char r_vaddr[4];
|
||||
char r_symndx[4];
|
||||
char r_type[2];
|
||||
#ifdef M68K_COFF_OFFSET
|
||||
char r_offset[4];
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#define RELOC struct external_reloc
|
||||
|
||||
#ifdef M68K_COFF_OFFSET
|
||||
#define RELSZ 14
|
||||
#else
|
||||
#define RELSZ 10
|
||||
#endif
|
||||
|
||||
/* Apollo specific STYP flags */
|
||||
|
||||
#define STYP_RELOCATED_NOT_LOADED 0x00010000 /* Section is relocated normally during linking, but need
|
||||
not be loaded during program execution */
|
||||
#define STYP_DEBUG 0x00020000 /* debug section */
|
||||
#define STYP_OVERLAY 0x00040000 /* Section is overlayed */
|
||||
#define STYP_INSTRUCTION 0x00200000 /* Section contains executable code */
|
||||
|
||||
#define STYP_ZERO 0x00800000 /* Section is initialized to zero */
|
||||
#define STYP_INSTALLED 0x02000000 /* Section should be installable in KGT */
|
||||
#define STYP_LOOK_INSTALLED 0x04000000 /* Look for section in KGT */
|
||||
#define STYP_SECALIGN1 0x08000000 /* Specially aligned section */
|
||||
#define STYP_SECALIGN2 0x10000000 /* " " " */
|
||||
#define STYP_COMPRESSED 0x20000000 /* No section data per se (s_scnptr = 0), but there are
|
||||
initialization directives for it in .rwdi section
|
||||
(used in conjunction with STYP_BSS) */
|
|
@ -0,0 +1,128 @@
|
|||
/* ARM COFF support for BFD.
|
||||
Copyright 1998, 1999, 2000, 2002, 2003, 2010 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#define COFFARM 1
|
||||
|
||||
#define L_LNNO_SIZE 2
|
||||
#define INCLUDE_COMDAT_FIELDS_IN_AUXENT
|
||||
#include "coff/external.h"
|
||||
|
||||
/* Bits for f_flags:
|
||||
F_RELFLG relocation info stripped from file
|
||||
F_EXEC file is executable (no unresolved external references)
|
||||
F_LNNO line numbers stripped from file
|
||||
F_LSYMS local symbols stripped from file
|
||||
F_INTERWORK file supports switching between ARM and Thumb instruction sets
|
||||
F_INTERWORK_SET the F_INTERWORK bit is valid
|
||||
F_APCS_FLOAT code passes float arguments in float registers
|
||||
F_PIC code is reentrant/position-independent
|
||||
F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax)
|
||||
F_APCS_26 file uses 26 bit ARM Procedure Calling Standard
|
||||
F_APCS_SET the F_APCS_26, F_APCS_FLOAT and F_PIC bits have been initialised
|
||||
F_SOFT_FLOAT code does not use floating point instructions. */
|
||||
|
||||
#define F_RELFLG (0x0001)
|
||||
#define F_EXEC (0x0002)
|
||||
#define F_LNNO (0x0004)
|
||||
#define F_LSYMS (0x0008)
|
||||
#define F_INTERWORK (0x0010)
|
||||
#define F_INTERWORK_SET (0x0020)
|
||||
#define F_APCS_FLOAT (0x0040)
|
||||
#undef F_AR16WR
|
||||
#define F_PIC (0x0080)
|
||||
#define F_AR32WR (0x0100)
|
||||
#define F_APCS_26 (0x0400)
|
||||
#define F_APCS_SET (0x0800)
|
||||
#define F_SOFT_FLOAT (0x2000)
|
||||
#define F_VFP_FLOAT (0x4000)
|
||||
|
||||
/* Bits stored in flags field of the internal_f structure */
|
||||
|
||||
#define F_INTERWORK (0x0010)
|
||||
#define F_APCS_FLOAT (0x0040)
|
||||
#define F_PIC (0x0080)
|
||||
#define F_APCS26 (0x1000)
|
||||
#define F_ARM_ARCHITECTURE_MASK (0x4000+0x0800+0x0400)
|
||||
#define F_ARM_2 (0x0400)
|
||||
#define F_ARM_2a (0x0800)
|
||||
#define F_ARM_3 (0x0c00)
|
||||
#define F_ARM_3M (0x4000)
|
||||
#define F_ARM_4 (0x4400)
|
||||
#define F_ARM_4T (0x4800)
|
||||
#define F_ARM_5 (0x4c00)
|
||||
|
||||
/*
|
||||
ARMMAGIC ought to encoded the procesor type,
|
||||
but it is too late to change it now, instead
|
||||
the flags field of the internal_f structure
|
||||
is used as shown above.
|
||||
|
||||
XXX - NC 5/6/97. */
|
||||
|
||||
#define ARMMAGIC 0xa00 /* I just made this up */
|
||||
|
||||
#define ARMBADMAG(x) (((x).f_magic != ARMMAGIC))
|
||||
|
||||
#define ARMPEMAGIC 0x1c0
|
||||
#define THUMBPEMAGIC 0x1c2
|
||||
|
||||
#undef ARMBADMAG
|
||||
#define ARMBADMAG(x) (((x).f_magic != ARMMAGIC) && ((x).f_magic != ARMPEMAGIC) && ((x).f_magic != THUMBPEMAGIC))
|
||||
|
||||
#define OMAGIC 0404 /* object files, eg as output */
|
||||
#define ZMAGIC 0413 /* demand load format, eg normal ld output */
|
||||
#define STMAGIC 0401 /* target shlib */
|
||||
#define SHMAGIC 0443 /* host shlib */
|
||||
|
||||
/* define some NT default values */
|
||||
/* #define NT_IMAGE_BASE 0x400000 moved to internal.h */
|
||||
#define NT_SECTION_ALIGNMENT 0x1000
|
||||
#define NT_FILE_ALIGNMENT 0x200
|
||||
#define NT_DEF_RESERVE 0x100000
|
||||
#define NT_DEF_COMMIT 0x1000
|
||||
|
||||
/* We use the .rdata section to hold read only data. */
|
||||
#define _LIT ".rdata"
|
||||
|
||||
/********************** RELOCATION DIRECTIVES **********************/
|
||||
#ifdef ARM_WINCE
|
||||
struct external_reloc
|
||||
{
|
||||
char r_vaddr[4];
|
||||
char r_symndx[4];
|
||||
char r_type[2];
|
||||
};
|
||||
|
||||
#define RELOC struct external_reloc
|
||||
#define RELSZ 10
|
||||
|
||||
#else
|
||||
struct external_reloc
|
||||
{
|
||||
char r_vaddr[4];
|
||||
char r_symndx[4];
|
||||
char r_type[2];
|
||||
char r_offset[4];
|
||||
};
|
||||
|
||||
#define RELOC struct external_reloc
|
||||
#define RELSZ 14
|
||||
#endif
|
||||
|
||||
#define ARM_NOTE_SECTION ".note"
|
|
@ -0,0 +1,49 @@
|
|||
/* Modifications of internal.h and m68k.h needed by A/UX
|
||||
|
||||
Copyright 2001, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
|
||||
Suggested by Ian Lance Taylor <ian@cygnus.com> */
|
||||
|
||||
#ifndef GNU_COFF_AUX_H
|
||||
#define GNU_COFF_AUX_H 1
|
||||
|
||||
#include "coff/internal.h"
|
||||
#include "coff/m68k.h"
|
||||
|
||||
/* Section contains 64-byte padded pathnames of shared libraries */
|
||||
#undef STYP_LIB
|
||||
#define STYP_LIB 0x200
|
||||
|
||||
/* Section contains shared library initialization code */
|
||||
#undef STYP_INIT
|
||||
#define STYP_INIT 0x400
|
||||
|
||||
/* Section contains .ident information */
|
||||
#undef STYP_IDENT
|
||||
#define STYP_IDENT 0x800
|
||||
|
||||
/* Section types used by bfd and gas not defined (directly) by A/UX */
|
||||
#undef STYP_OVER
|
||||
#define STYP_OVER 0
|
||||
#undef STYP_INFO
|
||||
#define STYP_INFO STYP_IDENT
|
||||
|
||||
/* Traditional name of the section tagged with STYP_LIB */
|
||||
#define _LIB ".lib"
|
||||
|
||||
#endif /* GNU_COFF_AUX_H */
|
|
@ -0,0 +1,411 @@
|
|||
/* Generic ECOFF support.
|
||||
This does not include symbol information, found in sym.h and
|
||||
symconst.h.
|
||||
|
||||
Copyright 2001, 2002, 2003, 2004, 2005, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#ifndef ECOFF_H
|
||||
#define ECOFF_H
|
||||
|
||||
/* Mips magic numbers used in filehdr. MIPS_MAGIC_LITTLE is used on
|
||||
little endian machines. MIPS_MAGIC_BIG is used on big endian
|
||||
machines. Where is MIPS_MAGIC_1 from? */
|
||||
#define MIPS_MAGIC_1 0x0180
|
||||
#define MIPS_MAGIC_LITTLE 0x0162
|
||||
#define MIPS_MAGIC_BIG 0x0160
|
||||
|
||||
/* These are the magic numbers used for MIPS code compiled at ISA
|
||||
level 2. */
|
||||
#define MIPS_MAGIC_LITTLE2 0x0166
|
||||
#define MIPS_MAGIC_BIG2 0x0163
|
||||
|
||||
/* These are the magic numbers used for MIPS code compiled at ISA
|
||||
level 3. */
|
||||
#define MIPS_MAGIC_LITTLE3 0x142
|
||||
#define MIPS_MAGIC_BIG3 0x140
|
||||
|
||||
/* Alpha magic numbers used in filehdr. */
|
||||
#define ALPHA_MAGIC 0x183
|
||||
#define ALPHA_MAGIC_BSD 0x185
|
||||
/* A compressed version of an ALPHA_MAGIC file created by DEC's tools. */
|
||||
#define ALPHA_MAGIC_COMPRESSED 0x188
|
||||
|
||||
/* Magic numbers used in a.out header. */
|
||||
#define ECOFF_AOUT_OMAGIC 0407 /* not demand paged (ld -N). */
|
||||
#define ECOFF_AOUT_ZMAGIC 0413 /* demand load format, eg normal ld output */
|
||||
|
||||
/* Names of special sections. */
|
||||
#define _TEXT ".text"
|
||||
#define _DATA ".data"
|
||||
#define _BSS ".bss"
|
||||
#define _RDATA ".rdata"
|
||||
#define _SDATA ".sdata"
|
||||
#define _SBSS ".sbss"
|
||||
#define _LITA ".lita"
|
||||
#define _LIT4 ".lit4"
|
||||
#define _LIT8 ".lit8"
|
||||
#define _LIB ".lib"
|
||||
#define _INIT ".init"
|
||||
#define _FINI ".fini"
|
||||
#define _PDATA ".pdata"
|
||||
#define _XDATA ".xdata"
|
||||
#define _GOT ".got"
|
||||
#define _HASH ".hash"
|
||||
#define _DYNSYM ".dynsym"
|
||||
#define _DYNSTR ".dynstr"
|
||||
#define _RELDYN ".rel.dyn"
|
||||
#define _CONFLIC ".conflic"
|
||||
#define _COMMENT ".comment"
|
||||
#define _LIBLIST ".liblist"
|
||||
#define _DYNAMIC ".dynamic"
|
||||
#define _RCONST ".rconst"
|
||||
|
||||
/* ECOFF uses some additional section flags. */
|
||||
#define STYP_RDATA 0x100
|
||||
#define STYP_SDATA 0x200
|
||||
#define STYP_SBSS 0x400
|
||||
#define STYP_GOT 0x1000
|
||||
#define STYP_DYNAMIC 0x2000
|
||||
#define STYP_DYNSYM 0x4000
|
||||
#define STYP_RELDYN 0x8000
|
||||
#define STYP_DYNSTR 0x10000
|
||||
#define STYP_HASH 0x20000
|
||||
#define STYP_LIBLIST 0x40000
|
||||
#define STYP_CONFLIC 0x100000
|
||||
#define STYP_ECOFF_FINI 0x1000000
|
||||
#define STYP_EXTENDESC 0x2000000 /* 0x02FFF000 bits => scn type, rest clr */
|
||||
#define STYP_LITA 0x4000000
|
||||
#define STYP_LIT8 0x8000000
|
||||
#define STYP_LIT4 0x10000000
|
||||
#define STYP_ECOFF_LIB 0x40000000
|
||||
#define STYP_ECOFF_INIT 0x80000000
|
||||
#define STYP_OTHER_LOAD (STYP_ECOFF_INIT | STYP_ECOFF_FINI)
|
||||
|
||||
/* extended section types */
|
||||
#define STYP_COMMENT 0x2100000
|
||||
#define STYP_RCONST 0x2200000
|
||||
#define STYP_XDATA 0x2400000
|
||||
#define STYP_PDATA 0x2800000
|
||||
|
||||
/* The linker needs a section to hold small common variables while
|
||||
linking. There is no convenient way to create it when the linker
|
||||
needs it, so we always create one for each BFD. We then avoid
|
||||
writing it out. */
|
||||
#define SCOMMON ".scommon"
|
||||
|
||||
/* If the extern bit in a reloc is 1, then r_symndx is an index into
|
||||
the external symbol table. If the extern bit is 0, then r_symndx
|
||||
indicates a section, and is one of the following values. */
|
||||
#define RELOC_SECTION_NONE 0
|
||||
#define RELOC_SECTION_TEXT 1
|
||||
#define RELOC_SECTION_RDATA 2
|
||||
#define RELOC_SECTION_DATA 3
|
||||
#define RELOC_SECTION_SDATA 4
|
||||
#define RELOC_SECTION_SBSS 5
|
||||
#define RELOC_SECTION_BSS 6
|
||||
#define RELOC_SECTION_INIT 7
|
||||
#define RELOC_SECTION_LIT8 8
|
||||
#define RELOC_SECTION_LIT4 9
|
||||
#define RELOC_SECTION_XDATA 10
|
||||
#define RELOC_SECTION_PDATA 11
|
||||
#define RELOC_SECTION_FINI 12
|
||||
#define RELOC_SECTION_LITA 13
|
||||
#define RELOC_SECTION_ABS 14
|
||||
#define RELOC_SECTION_RCONST 15
|
||||
|
||||
#define NUM_RELOC_SECTIONS 16
|
||||
|
||||
/********************** STABS **********************/
|
||||
|
||||
/* gcc uses mips-tfile to output type information in special stabs
|
||||
entries. These must match the corresponding definition in
|
||||
gcc/config/mips.h. At some point, these should probably go into a
|
||||
shared include file, but currently gcc and gdb do not share any
|
||||
directories. */
|
||||
#define CODE_MASK 0x8F300
|
||||
#define ECOFF_IS_STAB(sym) (((sym)->index & 0xFFF00) == CODE_MASK)
|
||||
#define ECOFF_MARK_STAB(code) ((code)+CODE_MASK)
|
||||
#define ECOFF_UNMARK_STAB(code) ((code)-CODE_MASK)
|
||||
#define STABS_SYMBOL "@stabs"
|
||||
|
||||
/********************** COFF **********************/
|
||||
|
||||
/* gcc also uses mips-tfile to output COFF debugging information.
|
||||
These are the values it uses when outputting the .type directive.
|
||||
These should also be in a shared include file. */
|
||||
#define N_BTMASK (017)
|
||||
#define N_TMASK (060)
|
||||
#define N_BTSHFT (4)
|
||||
#define N_TSHIFT (2)
|
||||
|
||||
/********************** AUX **********************/
|
||||
|
||||
/* The auxiliary type information is the same on all known ECOFF
|
||||
targets. I can't see any reason that it would ever change, so I am
|
||||
going to gamble and define the external structures here, in the
|
||||
target independent ECOFF header file. The internal forms are
|
||||
defined in coff/sym.h, which was originally donated by MIPS
|
||||
Computer Systems. */
|
||||
|
||||
/* Type information external record */
|
||||
|
||||
struct tir_ext {
|
||||
unsigned char t_bits1[1];
|
||||
unsigned char t_tq45[1];
|
||||
unsigned char t_tq01[1];
|
||||
unsigned char t_tq23[1];
|
||||
};
|
||||
|
||||
#define TIR_BITS1_FBITFIELD_BIG ((unsigned int) 0x80)
|
||||
#define TIR_BITS1_FBITFIELD_LITTLE ((unsigned int) 0x01)
|
||||
|
||||
#define TIR_BITS1_CONTINUED_BIG ((unsigned int) 0x40)
|
||||
#define TIR_BITS1_CONTINUED_LITTLE ((unsigned int) 0x02)
|
||||
|
||||
#define TIR_BITS1_BT_BIG ((unsigned int) 0x3F)
|
||||
#define TIR_BITS1_BT_SH_BIG 0
|
||||
#define TIR_BITS1_BT_LITTLE ((unsigned int) 0xFC)
|
||||
#define TIR_BITS1_BT_SH_LITTLE 2
|
||||
|
||||
#define TIR_BITS_TQ4_BIG ((unsigned int) 0xF0)
|
||||
#define TIR_BITS_TQ4_SH_BIG 4
|
||||
#define TIR_BITS_TQ5_BIG ((unsigned int) 0x0F)
|
||||
#define TIR_BITS_TQ5_SH_BIG 0
|
||||
#define TIR_BITS_TQ4_LITTLE ((unsigned int) 0x0F)
|
||||
#define TIR_BITS_TQ4_SH_LITTLE 0
|
||||
#define TIR_BITS_TQ5_LITTLE ((unsigned int) 0xF0)
|
||||
#define TIR_BITS_TQ5_SH_LITTLE 4
|
||||
|
||||
#define TIR_BITS_TQ0_BIG ((unsigned int) 0xF0)
|
||||
#define TIR_BITS_TQ0_SH_BIG 4
|
||||
#define TIR_BITS_TQ1_BIG ((unsigned int) 0x0F)
|
||||
#define TIR_BITS_TQ1_SH_BIG 0
|
||||
#define TIR_BITS_TQ0_LITTLE ((unsigned int) 0x0F)
|
||||
#define TIR_BITS_TQ0_SH_LITTLE 0
|
||||
#define TIR_BITS_TQ1_LITTLE ((unsigned int) 0xF0)
|
||||
#define TIR_BITS_TQ1_SH_LITTLE 4
|
||||
|
||||
#define TIR_BITS_TQ2_BIG ((unsigned int) 0xF0)
|
||||
#define TIR_BITS_TQ2_SH_BIG 4
|
||||
#define TIR_BITS_TQ3_BIG ((unsigned int) 0x0F)
|
||||
#define TIR_BITS_TQ3_SH_BIG 0
|
||||
#define TIR_BITS_TQ2_LITTLE ((unsigned int) 0x0F)
|
||||
#define TIR_BITS_TQ2_SH_LITTLE 0
|
||||
#define TIR_BITS_TQ3_LITTLE ((unsigned int) 0xF0)
|
||||
#define TIR_BITS_TQ3_SH_LITTLE 4
|
||||
|
||||
/* Relative symbol external record */
|
||||
|
||||
struct rndx_ext {
|
||||
unsigned char r_bits[4];
|
||||
};
|
||||
|
||||
#define RNDX_BITS0_RFD_SH_LEFT_BIG 4
|
||||
#define RNDX_BITS1_RFD_BIG ((unsigned int) 0xF0)
|
||||
#define RNDX_BITS1_RFD_SH_BIG 4
|
||||
|
||||
#define RNDX_BITS0_RFD_SH_LEFT_LITTLE 0
|
||||
#define RNDX_BITS1_RFD_LITTLE ((unsigned int) 0x0F)
|
||||
#define RNDX_BITS1_RFD_SH_LEFT_LITTLE 8
|
||||
|
||||
#define RNDX_BITS1_INDEX_BIG ((unsigned int) 0x0F)
|
||||
#define RNDX_BITS1_INDEX_SH_LEFT_BIG 16
|
||||
#define RNDX_BITS2_INDEX_SH_LEFT_BIG 8
|
||||
#define RNDX_BITS3_INDEX_SH_LEFT_BIG 0
|
||||
|
||||
#define RNDX_BITS1_INDEX_LITTLE ((unsigned int) 0xF0)
|
||||
#define RNDX_BITS1_INDEX_SH_LITTLE 4
|
||||
#define RNDX_BITS2_INDEX_SH_LEFT_LITTLE 4
|
||||
#define RNDX_BITS3_INDEX_SH_LEFT_LITTLE 12
|
||||
|
||||
/* Auxiliary symbol information external record */
|
||||
|
||||
union aux_ext {
|
||||
struct tir_ext a_ti;
|
||||
struct rndx_ext a_rndx;
|
||||
unsigned char a_dnLow[4];
|
||||
unsigned char a_dnHigh[4];
|
||||
unsigned char a_isym[4];
|
||||
unsigned char a_iss[4];
|
||||
unsigned char a_width[4];
|
||||
unsigned char a_count[4];
|
||||
};
|
||||
|
||||
#define AUX_GET_ANY(bigend, ax, field) \
|
||||
((bigend) ? bfd_getb32 ((ax)->field) : bfd_getl32 ((ax)->field))
|
||||
|
||||
#define AUX_GET_DNLOW(bigend, ax) AUX_GET_ANY ((bigend), (ax), a_dnLow)
|
||||
#define AUX_GET_DNHIGH(bigend, ax) AUX_GET_ANY ((bigend), (ax), a_dnHigh)
|
||||
#define AUX_GET_ISYM(bigend, ax) AUX_GET_ANY ((bigend), (ax), a_isym)
|
||||
#define AUX_GET_ISS(bigend, ax) AUX_GET_ANY ((bigend), (ax), a_iss)
|
||||
#define AUX_GET_WIDTH(bigend, ax) AUX_GET_ANY ((bigend), (ax), a_width)
|
||||
#define AUX_GET_COUNT(bigend, ax) AUX_GET_ANY ((bigend), (ax), a_count)
|
||||
|
||||
#define AUX_PUT_ANY(bigend, val, ax, field) \
|
||||
((bigend) \
|
||||
? (bfd_putb32 ((bfd_vma) (val), (ax)->field), 0) \
|
||||
: (bfd_putl32 ((bfd_vma) (val), (ax)->field), 0))
|
||||
|
||||
#define AUX_PUT_DNLOW(bigend, val, ax) \
|
||||
AUX_PUT_ANY ((bigend), (val), (ax), a_dnLow)
|
||||
#define AUX_PUT_DNHIGH(bigend, val, ax) \
|
||||
AUX_PUT_ANY ((bigend), (val), (ax), a_dnHigh)
|
||||
#define AUX_PUT_ISYM(bigend, val, ax) \
|
||||
AUX_PUT_ANY ((bigend), (val), (ax), a_isym)
|
||||
#define AUX_PUT_ISS(bigend, val, ax) \
|
||||
AUX_PUT_ANY ((bigend), (val), (ax), a_iss)
|
||||
#define AUX_PUT_WIDTH(bigend, val, ax) \
|
||||
AUX_PUT_ANY ((bigend), (val), (ax), a_width)
|
||||
#define AUX_PUT_COUNT(bigend, val, ax) \
|
||||
AUX_PUT_ANY ((bigend), (val), (ax), a_count)
|
||||
|
||||
/********************** SYMBOLS **********************/
|
||||
|
||||
/* For efficiency, gdb deals directly with the unswapped symbolic
|
||||
information (that way it only takes the time to swap information
|
||||
that it really needs to read). gdb originally retrieved the
|
||||
information directly from the BFD backend information, but that
|
||||
strategy, besides being sort of ugly, does not work for MIPS ELF,
|
||||
which also uses ECOFF debugging information. This structure holds
|
||||
pointers to the (mostly) unswapped symbolic information. */
|
||||
|
||||
struct ecoff_debug_info
|
||||
{
|
||||
/* The swapped ECOFF symbolic header. */
|
||||
HDRR symbolic_header;
|
||||
|
||||
/* Pointers to the unswapped symbolic information. Note that the
|
||||
pointers to external structures point to different sorts of
|
||||
information on different ECOFF targets. The ecoff_debug_swap
|
||||
structure provides the sizes of the structures and the functions
|
||||
needed to swap the information in and out. These pointers are
|
||||
all pointers to arrays, not single structures. They will be NULL
|
||||
if there are no instances of the relevant structure. These
|
||||
fields are also used by the assembler to output ECOFF debugging
|
||||
information. */
|
||||
unsigned char *line;
|
||||
void *external_dnr; /* struct dnr_ext */
|
||||
void *external_pdr; /* struct pdr_ext */
|
||||
void *external_sym; /* struct sym_ext */
|
||||
void *external_opt; /* struct opt_ext */
|
||||
union aux_ext *external_aux;
|
||||
char *ss;
|
||||
char *ssext;
|
||||
void *external_fdr; /* struct fdr_ext */
|
||||
void *external_rfd; /* struct rfd_ext */
|
||||
void *external_ext; /* struct ext_ext */
|
||||
|
||||
/* These fields are used when linking. They may disappear at some
|
||||
point. */
|
||||
char *ssext_end;
|
||||
void *external_ext_end;
|
||||
|
||||
/* When linking, this field holds a mapping from the input FDR
|
||||
numbers to the output numbers, and is used when writing out the
|
||||
external symbols. It is NULL if no mapping is required. */
|
||||
RFDT *ifdmap;
|
||||
|
||||
/* The swapped FDR information. Currently this is never NULL, but
|
||||
code using this structure should probably double-check in case
|
||||
this changes in the future. This is a pointer to an array, not a
|
||||
single structure. */
|
||||
FDR *fdr;
|
||||
};
|
||||
|
||||
/* These structures are used by the ECOFF find_nearest_line function. */
|
||||
|
||||
struct ecoff_fdrtab_entry
|
||||
{
|
||||
/* Base address in .text of this FDR. */
|
||||
bfd_vma base_addr;
|
||||
FDR *fdr;
|
||||
};
|
||||
|
||||
struct ecoff_find_line
|
||||
{
|
||||
/* Allocated memory to hold function and file names. */
|
||||
char *find_buffer;
|
||||
|
||||
/* FDR table, sorted by address: */
|
||||
long fdrtab_len;
|
||||
struct ecoff_fdrtab_entry *fdrtab;
|
||||
|
||||
/* Cache entry for most recently found line information. The sect
|
||||
field is NULL if this cache does not contain valid information. */
|
||||
struct
|
||||
{
|
||||
asection *sect;
|
||||
bfd_vma start;
|
||||
bfd_vma stop;
|
||||
const char *filename;
|
||||
const char *functionname;
|
||||
unsigned int line_num;
|
||||
} cache;
|
||||
};
|
||||
|
||||
/********************** SWAPPING **********************/
|
||||
|
||||
/* The generic ECOFF code needs to be able to swap debugging
|
||||
information in and out in the specific format used by a particular
|
||||
ECOFF implementation. This structure provides the information
|
||||
needed to do this. */
|
||||
|
||||
struct ecoff_debug_swap
|
||||
{
|
||||
/* Symbol table magic number. */
|
||||
int sym_magic;
|
||||
/* Alignment of debugging information. E.g., 4. */
|
||||
bfd_size_type debug_align;
|
||||
/* Sizes of external symbolic information. */
|
||||
bfd_size_type external_hdr_size;
|
||||
bfd_size_type external_dnr_size;
|
||||
bfd_size_type external_pdr_size;
|
||||
bfd_size_type external_sym_size;
|
||||
bfd_size_type external_opt_size;
|
||||
bfd_size_type external_fdr_size;
|
||||
bfd_size_type external_rfd_size;
|
||||
bfd_size_type external_ext_size;
|
||||
/* Functions to swap in external symbolic data. */
|
||||
void (*swap_hdr_in) (bfd *, void *, HDRR *);
|
||||
void (*swap_dnr_in) (bfd *, void *, DNR *);
|
||||
void (*swap_pdr_in) (bfd *, void *, PDR *);
|
||||
void (*swap_sym_in) (bfd *, void *, SYMR *);
|
||||
void (*swap_opt_in) (bfd *, void *, OPTR *);
|
||||
void (*swap_fdr_in) (bfd *, void *, FDR *);
|
||||
void (*swap_rfd_in) (bfd *, void *, RFDT *);
|
||||
void (*swap_ext_in) (bfd *, void *, EXTR *);
|
||||
void (*swap_tir_in) (int, const struct tir_ext *, TIR *);
|
||||
void (*swap_rndx_in) (int, const struct rndx_ext *, RNDXR *);
|
||||
/* Functions to swap out external symbolic data. */
|
||||
void (*swap_hdr_out) (bfd *, const HDRR *, void *);
|
||||
void (*swap_dnr_out) (bfd *, const DNR *, void *);
|
||||
void (*swap_pdr_out) (bfd *, const PDR *, void *);
|
||||
void (*swap_sym_out) (bfd *, const SYMR *, void *);
|
||||
void (*swap_opt_out) (bfd *, const OPTR *, void *);
|
||||
void (*swap_fdr_out) (bfd *, const FDR *, void *);
|
||||
void (*swap_rfd_out) (bfd *, const RFDT *, void *);
|
||||
void (*swap_ext_out) (bfd *, const EXTR *, void *);
|
||||
void (*swap_tir_out) (int, const TIR *, struct tir_ext *);
|
||||
void (*swap_rndx_out) (int, const RNDXR *, struct rndx_ext *);
|
||||
/* Function to read symbol data and set up pointers in
|
||||
ecoff_debug_info structure. The section argument is used for
|
||||
ELF, not straight ECOFF. */
|
||||
bfd_boolean (*read_debug_info) (bfd *, asection *, struct ecoff_debug_info *);
|
||||
};
|
||||
|
||||
#endif /* ! defined (ECOFF_H) */
|
|
@ -0,0 +1,269 @@
|
|||
/* external.h -- External COFF structures
|
||||
|
||||
Copyright 2001, 2006, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#ifndef COFF_EXTERNAL_H
|
||||
#define COFF_EXTERNAL_H
|
||||
|
||||
#ifndef DO_NOT_DEFINE_FILHDR
|
||||
/********************** FILE HEADER **********************/
|
||||
|
||||
struct external_filehdr
|
||||
{
|
||||
char f_magic[2]; /* magic number */
|
||||
char f_nscns[2]; /* number of sections */
|
||||
char f_timdat[4]; /* time & date stamp */
|
||||
char f_symptr[4]; /* file pointer to symtab */
|
||||
char f_nsyms[4]; /* number of symtab entries */
|
||||
char f_opthdr[2]; /* sizeof(optional hdr) */
|
||||
char f_flags[2]; /* flags */
|
||||
};
|
||||
|
||||
#define FILHDR struct external_filehdr
|
||||
#define FILHSZ 20
|
||||
#endif
|
||||
|
||||
#ifndef DO_NOT_DEFINE_AOUTHDR
|
||||
/********************** AOUT "OPTIONAL HEADER" **********************/
|
||||
|
||||
typedef struct external_aouthdr
|
||||
{
|
||||
char magic[2]; /* type of file */
|
||||
char vstamp[2]; /* version stamp */
|
||||
char tsize[4]; /* text size in bytes, padded to FW bdry*/
|
||||
char dsize[4]; /* initialized data " " */
|
||||
char bsize[4]; /* uninitialized data " " */
|
||||
char entry[4]; /* entry pt. */
|
||||
char text_start[4]; /* base of text used for this file */
|
||||
char data_start[4]; /* base of data used for this file */
|
||||
} ATTRIBUTE_PACKED
|
||||
AOUTHDR;
|
||||
|
||||
#define AOUTHDRSZ 28
|
||||
#define AOUTSZ 28
|
||||
|
||||
typedef struct external_aouthdr64
|
||||
{
|
||||
char magic[2]; /* Type of file. */
|
||||
char vstamp[2]; /* Version stamp. */
|
||||
char tsize[4]; /* Text size in bytes, padded to FW bdry*/
|
||||
char dsize[4]; /* Initialized data " ". */
|
||||
char bsize[4]; /* Uninitialized data " ". */
|
||||
char entry[4]; /* Entry pt. */
|
||||
char text_start[4]; /* Base of text used for this file. */
|
||||
}
|
||||
AOUTHDR64;
|
||||
#define AOUTHDRSZ64 24
|
||||
|
||||
#endif /* not DO_NOT_DEFINE_AOUTHDR */
|
||||
|
||||
#ifndef DO_NOT_DEFINE_SCNHDR
|
||||
/********************** SECTION HEADER **********************/
|
||||
|
||||
struct external_scnhdr
|
||||
{
|
||||
char s_name[8]; /* section name */
|
||||
char s_paddr[4]; /* physical address, aliased s_nlib */
|
||||
char s_vaddr[4]; /* virtual address */
|
||||
char s_size[4]; /* section size */
|
||||
char s_scnptr[4]; /* file ptr to raw data for section */
|
||||
char s_relptr[4]; /* file ptr to relocation */
|
||||
char s_lnnoptr[4]; /* file ptr to line numbers */
|
||||
char s_nreloc[2]; /* number of relocation entries */
|
||||
char s_nlnno[2]; /* number of line number entries */
|
||||
char s_flags[4]; /* flags */
|
||||
};
|
||||
|
||||
#define SCNHDR struct external_scnhdr
|
||||
#define SCNHSZ 40
|
||||
|
||||
/* Names of "special" sections. */
|
||||
|
||||
#define _TEXT ".text"
|
||||
#define _DATA ".data"
|
||||
#define _BSS ".bss"
|
||||
#define _COMMENT ".comment"
|
||||
#define _LIB ".lib"
|
||||
#endif /* not DO_NOT_DEFINE_SCNHDR */
|
||||
|
||||
#ifndef DO_NOT_DEFINE_LINENO
|
||||
|
||||
/********************** LINE NUMBERS **********************/
|
||||
|
||||
#ifndef L_LNNO_SIZE
|
||||
#error L_LNNO_SIZE needs to be defined
|
||||
#endif
|
||||
|
||||
/* 1 line number entry for every "breakpointable" source line in a section.
|
||||
Line numbers are grouped on a per function basis; first entry in a function
|
||||
grouping will have l_lnno = 0 and in place of physical address will be the
|
||||
symbol table index of the function name. */
|
||||
struct external_lineno
|
||||
{
|
||||
union
|
||||
{
|
||||
char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
|
||||
char l_paddr[4]; /* (physical) address of line number */
|
||||
} l_addr;
|
||||
|
||||
char l_lnno[L_LNNO_SIZE]; /* line number */
|
||||
};
|
||||
|
||||
#define LINENO struct external_lineno
|
||||
#define LINESZ (4 + L_LNNO_SIZE)
|
||||
|
||||
#if L_LNNO_SIZE == 4
|
||||
#define GET_LINENO_LNNO(abfd, ext) H_GET_32 (abfd, (ext->l_lnno))
|
||||
#define PUT_LINENO_LNNO(abfd, val, ext) H_PUT_32 (abfd, val, (ext->l_lnno))
|
||||
#endif
|
||||
#if L_LNNO_SIZE == 2
|
||||
#define GET_LINENO_LNNO(abfd, ext) H_GET_16 (abfd, (ext->l_lnno))
|
||||
#define PUT_LINENO_LNNO(abfd, val, ext) H_PUT_16 (abfd, val, (ext->l_lnno))
|
||||
#endif
|
||||
|
||||
#endif /* not DO_NOT_DEFINE_LINENO */
|
||||
|
||||
#ifndef DO_NOT_DEFINE_SYMENT
|
||||
/********************** SYMBOLS **********************/
|
||||
|
||||
#define E_SYMNMLEN 8 /* # characters in a symbol name */
|
||||
#ifndef E_FILNMLEN
|
||||
#define E_FILNMLEN 14
|
||||
#endif
|
||||
#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
|
||||
|
||||
struct external_syment
|
||||
{
|
||||
union
|
||||
{
|
||||
char e_name[E_SYMNMLEN];
|
||||
|
||||
struct
|
||||
{
|
||||
char e_zeroes[4];
|
||||
char e_offset[4];
|
||||
} e;
|
||||
} e;
|
||||
|
||||
char e_value[4];
|
||||
char e_scnum[2];
|
||||
char e_type[2];
|
||||
char e_sclass[1];
|
||||
char e_numaux[1];
|
||||
} ATTRIBUTE_PACKED ;
|
||||
|
||||
#define SYMENT struct external_syment
|
||||
#define SYMESZ 18
|
||||
|
||||
#ifndef N_BTMASK
|
||||
#define N_BTMASK 0xf
|
||||
#endif
|
||||
|
||||
#ifndef N_TMASK
|
||||
#define N_TMASK 0x30
|
||||
#endif
|
||||
|
||||
#ifndef N_BTSHFT
|
||||
#define N_BTSHFT 4
|
||||
#endif
|
||||
|
||||
#ifndef N_TSHIFT
|
||||
#define N_TSHIFT 2
|
||||
#endif
|
||||
|
||||
#endif /* not DO_NOT_DEFINE_SYMENT */
|
||||
|
||||
#ifndef DO_NOT_DEFINE_AUXENT
|
||||
|
||||
union external_auxent
|
||||
{
|
||||
struct
|
||||
{
|
||||
char x_tagndx[4]; /* str, un, or enum tag indx */
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
char x_lnno[2]; /* declaration line number */
|
||||
char x_size[2]; /* str/union/array size */
|
||||
} x_lnsz;
|
||||
|
||||
char x_fsize[4]; /* size of function */
|
||||
|
||||
} x_misc;
|
||||
|
||||
union
|
||||
{
|
||||
struct /* if ISFCN, tag, or .bb */
|
||||
{
|
||||
char x_lnnoptr[4]; /* ptr to fcn line # */
|
||||
char x_endndx[4]; /* entry ndx past block end */
|
||||
} x_fcn;
|
||||
|
||||
struct /* if ISARY, up to 4 dimen. */
|
||||
{
|
||||
char x_dimen[E_DIMNUM][2];
|
||||
} x_ary;
|
||||
|
||||
} x_fcnary;
|
||||
|
||||
char x_tvndx[2]; /* tv index */
|
||||
|
||||
} x_sym;
|
||||
|
||||
union
|
||||
{
|
||||
char x_fname[E_FILNMLEN];
|
||||
|
||||
struct
|
||||
{
|
||||
char x_zeroes[4];
|
||||
char x_offset[4];
|
||||
} x_n;
|
||||
|
||||
} x_file;
|
||||
|
||||
struct
|
||||
{
|
||||
char x_scnlen[4]; /* section length */
|
||||
char x_nreloc[2]; /* # relocation entries */
|
||||
char x_nlinno[2]; /* # line numbers */
|
||||
#ifdef INCLUDE_COMDAT_FIELDS_IN_AUXENT
|
||||
char x_checksum[4]; /* section COMDAT checksum */
|
||||
char x_associated[2]; /* COMDAT associated section index */
|
||||
char x_comdat[1]; /* COMDAT selection number */
|
||||
#endif
|
||||
} x_scn;
|
||||
|
||||
struct
|
||||
{
|
||||
char x_tvfill[4]; /* tv fill value */
|
||||
char x_tvlen[2]; /* length of .tv */
|
||||
char x_tvran[2][2]; /* tv range */
|
||||
} x_tv; /* info about .tv section (in auxent of symbol .tv)) */
|
||||
} ATTRIBUTE_PACKED ;
|
||||
|
||||
#define AUXENT union external_auxent
|
||||
#define AUXESZ 18
|
||||
|
||||
#define _ETEXT "etext"
|
||||
|
||||
#endif /* not DO_NOT_DEFINE_AUXENT */
|
||||
|
||||
#endif /* COFF_EXTERNAL_H */
|
|
@ -0,0 +1,36 @@
|
|||
/* COFF information for PC running go32.
|
||||
|
||||
Copyright 2001, 2005, 2009, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
struct external_filehdr_go32_exe
|
||||
{
|
||||
char stub[GO32_STUBSIZE]; /* the stub to load the image */
|
||||
/* the standard COFF header */
|
||||
char f_magic[2]; /* magic number */
|
||||
char f_nscns[2]; /* number of sections */
|
||||
char f_timdat[4]; /* time & date stamp */
|
||||
char f_symptr[4]; /* file pointer to symtab */
|
||||
char f_nsyms[4]; /* number of symtab entries */
|
||||
char f_opthdr[2]; /* sizeof(optional hdr) */
|
||||
char f_flags[2]; /* flags */
|
||||
};
|
||||
|
||||
#undef FILHDR
|
||||
#define FILHDR struct external_filehdr_go32_exe
|
||||
#undef FILHSZ
|
||||
#define FILHSZ GO32_STUBSIZE+20
|
|
@ -0,0 +1,55 @@
|
|||
/* coff information for Renesas H8/300 and H8/300-H
|
||||
|
||||
Copyright 2001, 2003, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#define L_LNNO_SIZE 4
|
||||
#include "coff/external.h"
|
||||
|
||||
#define H8300MAGIC 0x8300
|
||||
#define H8300HMAGIC 0x8301
|
||||
#define H8300SMAGIC 0x8302
|
||||
#define H8300HNMAGIC 0x8303
|
||||
#define H8300SNMAGIC 0x8304
|
||||
|
||||
#define H8300BADMAG(x) (((x).f_magic != H8300MAGIC))
|
||||
#define H8300HBADMAG(x) (((x).f_magic != H8300HMAGIC))
|
||||
#define H8300SBADMAG(x) (((x).f_magic != H8300SMAGIC))
|
||||
#define H8300HNBADMAG(x) (((x).f_magic != H8300HNMAGIC))
|
||||
#define H8300SNBADMAG(x) (((x).f_magic != H8300SNMAGIC))
|
||||
|
||||
/* Relocation directives. */
|
||||
|
||||
/* The external reloc has an offset field, because some of the reloc
|
||||
types on the h8 don't have room in the instruction for the entire
|
||||
offset - eg the strange jump and high page addressing modes. */
|
||||
|
||||
struct external_reloc
|
||||
{
|
||||
char r_vaddr[4];
|
||||
char r_symndx[4];
|
||||
char r_offset[4];
|
||||
char r_type[2];
|
||||
char r_stuff[2];
|
||||
};
|
||||
|
||||
#define RELOC struct external_reloc
|
||||
#define RELSZ 16
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
/* coff information for Renesas H8/500
|
||||
|
||||
Copyright 2001, 2003, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#define L_LNNO_SIZE 4
|
||||
#include "coff/external.h"
|
||||
|
||||
#define H8500MAGIC 0x8500
|
||||
|
||||
#define H8500BADMAG(x) ((0xffff && ((x).f_magic) != H8500MAGIC))
|
||||
|
||||
/********************** RELOCATION DIRECTIVES **********************/
|
||||
|
||||
/* The external reloc has an offset field, because some of the reloc
|
||||
types on the h8 don't have room in the instruction for the entire
|
||||
offset - eg the strange jump and high page addressing modes. */
|
||||
|
||||
struct external_reloc
|
||||
{
|
||||
char r_vaddr[4];
|
||||
char r_symndx[4];
|
||||
char r_offset[4];
|
||||
char r_type[2];
|
||||
char r_stuff[2];
|
||||
};
|
||||
|
||||
#define RELOC struct external_reloc
|
||||
#define RELSZ 16
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
/* coff information for Intel 386/486.
|
||||
|
||||
Copyright 2001, 2009, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#define L_LNNO_SIZE 2
|
||||
#define INCLUDE_COMDAT_FIELDS_IN_AUXENT
|
||||
#include "coff/external.h"
|
||||
|
||||
#define COFF_PAGE_SIZE 0x1000
|
||||
|
||||
/* Bits for f_flags:
|
||||
F_RELFLG Relocation info stripped from file
|
||||
F_EXEC File is executable (no unresolved external references)
|
||||
F_LNNO Line numbers stripped from file
|
||||
F_LSYMS Local symbols stripped from file
|
||||
F_AR32WR File has byte ordering of an AR32WR machine (e.g. vax). */
|
||||
|
||||
#define F_RELFLG (0x0001)
|
||||
#define F_EXEC (0x0002)
|
||||
#define F_LNNO (0x0004)
|
||||
#define F_LSYMS (0x0008)
|
||||
|
||||
#define I386MAGIC 0x14c
|
||||
#define I386PTXMAGIC 0x154
|
||||
#define I386AIXMAGIC 0x175
|
||||
|
||||
/* This is Lynx's all-platform magic number for executables. */
|
||||
|
||||
#define LYNXCOFFMAGIC 0415
|
||||
|
||||
#define I386BADMAG(x) ( ((x).f_magic != I386MAGIC) \
|
||||
&& (x).f_magic != I386AIXMAGIC \
|
||||
&& (x).f_magic != I386PTXMAGIC \
|
||||
&& (x).f_magic != LYNXCOFFMAGIC)
|
||||
|
||||
#define OMAGIC 0404 /* Object files, eg as output. */
|
||||
#define ZMAGIC 0413 /* Demand load format, eg normal ld output. */
|
||||
#define STMAGIC 0401 /* Target shlib. */
|
||||
#define SHMAGIC 0443 /* Host shlib. */
|
||||
|
||||
/* Define some NT default values. */
|
||||
/* #define NT_IMAGE_BASE 0x400000 moved to internal.h */
|
||||
#define NT_SECTION_ALIGNMENT 0x1000
|
||||
#define NT_FILE_ALIGNMENT 0x200
|
||||
#define NT_DEF_RESERVE 0x100000
|
||||
#define NT_DEF_COMMIT 0x1000
|
||||
|
||||
/* Relocation directives. */
|
||||
|
||||
struct external_reloc
|
||||
{
|
||||
char r_vaddr[4];
|
||||
char r_symndx[4];
|
||||
char r_type[2];
|
||||
};
|
||||
|
||||
#define RELOC struct external_reloc
|
||||
#define RELSZ 10
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
/* COFF information for the Intel i860.
|
||||
|
||||
Copyright 2001, 2003, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* This file was hacked from i386.h [dolan@ssd.intel.com] */
|
||||
|
||||
#define L_LNNO_SIZE 2
|
||||
#include "coff/external.h"
|
||||
|
||||
/* Bits for f_flags:
|
||||
F_RELFLG relocation info stripped from file
|
||||
F_EXEC file is executable (no unresolved external references)
|
||||
F_LNNO line numbers stripped from file
|
||||
F_LSYMS local symbols stripped from file
|
||||
F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax). */
|
||||
|
||||
#define F_RELFLG (0x0001)
|
||||
#define F_EXEC (0x0002)
|
||||
#define F_LNNO (0x0004)
|
||||
#define F_LSYMS (0x0008)
|
||||
|
||||
#define I860MAGIC 0x14d
|
||||
|
||||
#define I860BADMAG(x) ((x).f_magic != I860MAGIC)
|
||||
|
||||
#undef AOUTSZ
|
||||
#define AOUTSZ 36
|
||||
|
||||
/* FIXME: What are the a.out magic numbers? */
|
||||
|
||||
#define _ETEXT "etext"
|
||||
|
||||
/********************** RELOCATION DIRECTIVES **********************/
|
||||
|
||||
struct external_reloc
|
||||
{
|
||||
char r_vaddr[4];
|
||||
char r_symndx[4];
|
||||
char r_type[2];
|
||||
};
|
||||
|
||||
#define RELOC struct external_reloc
|
||||
#define RELSZ 10
|
||||
|
||||
/* The relocation directory entry types.
|
||||
PAIR : The low half that follows relates to the preceeding HIGH[ADJ].
|
||||
HIGH : The high half of a 32-bit constant.
|
||||
LOWn : The low half, insn bits 15..(n-1), 2^n-byte aligned.
|
||||
SPLITn : The low half, insn bits 20..16 and 10..(n-1), 2^n-byte aligned.
|
||||
HIGHADJ: Similar to HIGH, but with adjustment.
|
||||
BRADDR : 26-bit branch displacement.
|
||||
|
||||
Note: The Intel assembler manual lists LOW4 as one of the
|
||||
relocation types, but it appears to be useless for the i860.
|
||||
We will recognize it anyway, just in case it actually appears in
|
||||
any object files. */
|
||||
|
||||
enum {
|
||||
COFF860_R_PAIR = 0x1c,
|
||||
COFF860_R_HIGH = 0x1e,
|
||||
COFF860_R_LOW0 = 0x1f,
|
||||
COFF860_R_LOW1 = 0x20,
|
||||
COFF860_R_LOW2 = 0x21,
|
||||
COFF860_R_LOW3 = 0x22,
|
||||
COFF860_R_LOW4 = 0x23,
|
||||
COFF860_R_SPLIT0 = 0x24,
|
||||
COFF860_R_SPLIT1 = 0x25,
|
||||
COFF860_R_SPLIT2 = 0x26,
|
||||
COFF860_R_HIGHADJ = 0x27,
|
||||
COFF860_R_BRADDR = 0x28
|
||||
};
|
||||
|
|
@ -0,0 +1,320 @@
|
|||
/* coff information for 80960. Origins: Intel corp, natch.
|
||||
|
||||
Copyright 2001, 2010 Free Software Foundation, Inc.
|
||||
|
||||
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/* NOTE: Tagentries (cf TAGBITS) are no longer used by the 960 */
|
||||
|
||||
/********************** FILE HEADER **********************/
|
||||
|
||||
struct external_filehdr
|
||||
{
|
||||
char f_magic[2]; /* magic number */
|
||||
char f_nscns[2]; /* number of sections */
|
||||
char f_timdat[4]; /* time & date stamp */
|
||||
char f_symptr[4]; /* file pointer to symtab */
|
||||
char f_nsyms[4]; /* number of symtab entries */
|
||||
char f_opthdr[2]; /* sizeof(optional hdr) */
|
||||
char f_flags[2]; /* flags */
|
||||
};
|
||||
|
||||
#define OMAGIC (0407) /* old impure format. data immediately
|
||||
follows text. both sections are rw. */
|
||||
#define NMAGIC (0410) /* split i&d, read-only text */
|
||||
|
||||
/*
|
||||
* Intel 80960 (I960) processor flags.
|
||||
* F_I960TYPE == mask for processor type field.
|
||||
*/
|
||||
|
||||
#define F_I960TYPE (0xf000)
|
||||
#define F_I960CORE (0x1000)
|
||||
#define F_I960KB (0x2000)
|
||||
#define F_I960SB (0x2000)
|
||||
#define F_I960MC (0x3000)
|
||||
#define F_I960XA (0x4000)
|
||||
#define F_I960CA (0x5000)
|
||||
#define F_I960KA (0x6000)
|
||||
#define F_I960SA (0x6000)
|
||||
#define F_I960JX (0x7000)
|
||||
#define F_I960HX (0x8000)
|
||||
|
||||
|
||||
/** i80960 Magic Numbers
|
||||
*/
|
||||
|
||||
#define I960ROMAGIC (0x160) /* read-only text segments */
|
||||
#define I960RWMAGIC (0x161) /* read-write text segments */
|
||||
|
||||
#define I960BADMAG(x) (((x).f_magic!=I960ROMAGIC) && ((x).f_magic!=I960RWMAGIC))
|
||||
|
||||
#define FILHDR struct external_filehdr
|
||||
#define FILHSZ 20
|
||||
|
||||
/********************** AOUT "OPTIONAL HEADER" **********************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long phys_addr;
|
||||
unsigned long bitarray;
|
||||
} TAGBITS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char magic[2]; /* type of file */
|
||||
char vstamp[2]; /* version stamp */
|
||||
char tsize[4]; /* text size in bytes, padded to FW bdry*/
|
||||
char dsize[4]; /* initialized data " " */
|
||||
char bsize[4]; /* uninitialized data " " */
|
||||
char entry[4]; /* entry pt. */
|
||||
char text_start[4]; /* base of text used for this file */
|
||||
char data_start[4]; /* base of data used for this file */
|
||||
char tagentries[4]; /* number of tag entries to follow */
|
||||
}
|
||||
AOUTHDR;
|
||||
|
||||
/* return a pointer to the tag bits array */
|
||||
|
||||
#define TAGPTR(aout) ((TAGBITS *) (&(aout.tagentries)+1))
|
||||
|
||||
/* compute size of a header */
|
||||
|
||||
/*#define AOUTSZ(aout) (sizeof(AOUTHDR)+(aout.tagentries*sizeof(TAGBITS)))*/
|
||||
#define AOUTSZ 32
|
||||
#define AOUTHDRSZ 32
|
||||
|
||||
|
||||
/********************** SECTION HEADER **********************/
|
||||
|
||||
struct external_scnhdr
|
||||
{
|
||||
char s_name[8]; /* section name */
|
||||
char s_paddr[4]; /* physical address, aliased s_nlib */
|
||||
char s_vaddr[4]; /* virtual address */
|
||||
char s_size[4]; /* section size */
|
||||
char s_scnptr[4]; /* file ptr to raw data for section */
|
||||
char s_relptr[4]; /* file ptr to relocation */
|
||||
char s_lnnoptr[4]; /* file ptr to line numbers */
|
||||
char s_nreloc[2]; /* number of relocation entries */
|
||||
char s_nlnno[2]; /* number of line number entries*/
|
||||
char s_flags[4]; /* flags */
|
||||
char s_align[4]; /* section alignment */
|
||||
};
|
||||
|
||||
|
||||
#define SCNHDR struct external_scnhdr
|
||||
#define SCNHSZ 44
|
||||
|
||||
/*
|
||||
* names of "special" sections
|
||||
*/
|
||||
#define _TEXT ".text"
|
||||
#define _DATA ".data"
|
||||
#define _BSS ".bss"
|
||||
|
||||
/********************** LINE NUMBERS **********************/
|
||||
|
||||
/* 1 line number entry for every "breakpointable" source line in a section.
|
||||
* Line numbers are grouped on a per function basis; first entry in a function
|
||||
* grouping will have l_lnno = 0 and in place of physical address will be the
|
||||
* symbol table index of the function name.
|
||||
*/
|
||||
struct external_lineno
|
||||
{
|
||||
union
|
||||
{
|
||||
char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
|
||||
char l_paddr[4]; /* (physical) address of line number */
|
||||
} l_addr;
|
||||
|
||||
char l_lnno[2]; /* line number */
|
||||
char padding[2]; /* force alignment */
|
||||
};
|
||||
|
||||
|
||||
#define LINENO struct external_lineno
|
||||
#define LINESZ 8
|
||||
|
||||
/********************** SYMBOLS **********************/
|
||||
|
||||
#define E_SYMNMLEN 8 /* # characters in a symbol name */
|
||||
#define E_FILNMLEN 14 /* # characters in a file name */
|
||||
#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
|
||||
|
||||
struct external_syment
|
||||
{
|
||||
union
|
||||
{
|
||||
char e_name[E_SYMNMLEN];
|
||||
|
||||
struct
|
||||
{
|
||||
char e_zeroes[4];
|
||||
char e_offset[4];
|
||||
} e;
|
||||
} e;
|
||||
|
||||
char e_value[4];
|
||||
char e_scnum[2];
|
||||
char e_flags[2];
|
||||
char e_type[4];
|
||||
char e_sclass[1];
|
||||
char e_numaux[1];
|
||||
char pad2[2];
|
||||
};
|
||||
|
||||
#define N_BTMASK (0x1f)
|
||||
#define N_TMASK (0x60)
|
||||
#define N_BTSHFT (5)
|
||||
#define N_TSHIFT (2)
|
||||
|
||||
union external_auxent
|
||||
{
|
||||
struct
|
||||
{
|
||||
char x_tagndx[4]; /* str, un, or enum tag indx */
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
char x_lnno[2]; /* declaration line number */
|
||||
char x_size[2]; /* str/union/array size */
|
||||
} x_lnsz;
|
||||
|
||||
char x_fsize[4]; /* size of function */
|
||||
|
||||
} x_misc;
|
||||
|
||||
union
|
||||
{
|
||||
struct /* if ISFCN, tag, or .bb */
|
||||
{
|
||||
char x_lnnoptr[4]; /* ptr to fcn line # */
|
||||
char x_endndx[4]; /* entry ndx past block end */
|
||||
} x_fcn;
|
||||
|
||||
struct /* if ISARY, up to 4 dimen. */
|
||||
{
|
||||
char x_dimen[E_DIMNUM][2];
|
||||
} x_ary;
|
||||
|
||||
} x_fcnary;
|
||||
|
||||
char x_tvndx[2]; /* tv index */
|
||||
|
||||
} x_sym;
|
||||
|
||||
union
|
||||
{
|
||||
char x_fname[E_FILNMLEN];
|
||||
|
||||
struct
|
||||
{
|
||||
char x_zeroes[4];
|
||||
char x_offset[4];
|
||||
} x_n;
|
||||
|
||||
} x_file;
|
||||
|
||||
struct
|
||||
{
|
||||
char x_scnlen[4]; /* section length */
|
||||
char x_nreloc[2]; /* # relocation entries */
|
||||
char x_nlinno[2]; /* # line numbers */
|
||||
|
||||
} x_scn;
|
||||
|
||||
struct
|
||||
{
|
||||
char x_tvfill[4]; /* tv fill value */
|
||||
char x_tvlen[2]; /* length of .tv */
|
||||
char x_tvran[2][2]; /* tv range */
|
||||
|
||||
} x_tv; /* info about .tv section (in auxent of symbol .tv)) */
|
||||
|
||||
/******************************************
|
||||
* I960-specific *2nd* aux. entry formats
|
||||
******************************************/
|
||||
struct
|
||||
{
|
||||
/* This is a very old typo that keeps getting propagated. */
|
||||
#define x_stdindx x_stindx
|
||||
char x_stindx[4]; /* sys. table entry */
|
||||
} x_sc; /* system call entry */
|
||||
|
||||
struct
|
||||
{
|
||||
char x_balntry[4]; /* BAL entry point */
|
||||
} x_bal; /* BAL-callable function */
|
||||
|
||||
struct
|
||||
{
|
||||
char x_timestamp[4]; /* time stamp */
|
||||
char x_idstring[20]; /* producer identity string */
|
||||
|
||||
} x_ident; /* Producer ident info */
|
||||
};
|
||||
|
||||
#define SYMENT struct external_syment
|
||||
#define SYMESZ 24
|
||||
#define AUXENT union external_auxent
|
||||
#define AUXESZ 24
|
||||
|
||||
# define _ETEXT "_etext"
|
||||
|
||||
/********************** RELOCATION DIRECTIVES **********************/
|
||||
|
||||
struct external_reloc
|
||||
{
|
||||
char r_vaddr[4];
|
||||
char r_symndx[4];
|
||||
char r_type[2];
|
||||
char pad[2];
|
||||
};
|
||||
|
||||
/* r_type values for the i960. */
|
||||
|
||||
/* The i960 uses R_RELLONG, which is defined in internal.h as 0x11.
|
||||
It is an absolute 32 bit relocation. */
|
||||
|
||||
#define R_IPRMED (0x19) /* 24-bit ip-relative relocation */
|
||||
#define R_OPTCALL (0x1b) /* 32-bit optimizable call (leafproc/sysproc) */
|
||||
#define R_OPTCALLX (0x1c) /* 64-bit optimizable call (leafproc/sysproc) */
|
||||
|
||||
/* The following relocation types are defined use by relaxing linkers,
|
||||
which convert 32 bit calls (which require a 64 bit instruction)
|
||||
into 24 bit calls (which require a 32 bit instruction) when
|
||||
possible. It will be possible whenever the target of the call is
|
||||
within a 24 bit range of the call instruction.
|
||||
|
||||
It is always safe to ignore these relocations. They only serve to
|
||||
mark points which the relaxing linker will have to consider. The
|
||||
assembler must ensure that the correct code is generated even if
|
||||
the relocations are ignored. In particular, this means that the
|
||||
R_IPR13 relocation may not appear with an external symbol. */
|
||||
|
||||
#define R_IPR13 (0x1d) /* 13 bit ip-relative branch */
|
||||
#define R_ALIGN (0x1e) /* alignment marker. This has no
|
||||
associated symbol. Instead, the
|
||||
r_symndx field indicates the
|
||||
require alignment at this point in
|
||||
the file. It must be a power of 2. */
|
||||
|
||||
#define RELOC struct external_reloc
|
||||
#define RELSZ 12
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue