| 1 | /* BFD back-end for Sparc COFF files.
|
|---|
| 2 | Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001, 2002
|
|---|
| 3 | Free Software Foundation, Inc.
|
|---|
| 4 | Written by Cygnus Support.
|
|---|
| 5 |
|
|---|
| 6 | This file is part of BFD, the Binary File Descriptor library.
|
|---|
| 7 |
|
|---|
| 8 | This program is free software; you can redistribute it and/or modify
|
|---|
| 9 | it under the terms of the GNU General Public License as published by
|
|---|
| 10 | the Free Software Foundation; either version 2 of the License, or
|
|---|
| 11 | (at your option) any later version.
|
|---|
| 12 |
|
|---|
| 13 | This program is distributed in the hope that it will be useful,
|
|---|
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 16 | GNU General Public License for more details.
|
|---|
| 17 |
|
|---|
| 18 | You should have received a copy of the GNU General Public License
|
|---|
| 19 | along with this program; if not, write to the Free Software
|
|---|
| 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|---|
| 21 |
|
|---|
| 22 | #include "bfd.h"
|
|---|
| 23 | #include "sysdep.h"
|
|---|
| 24 | #include "libbfd.h"
|
|---|
| 25 | #include "coff/sparc.h"
|
|---|
| 26 | #include "coff/internal.h"
|
|---|
| 27 | #include "libcoff.h"
|
|---|
| 28 |
|
|---|
| 29 | #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
|
|---|
| 30 |
|
|---|
| 31 | #define BADMAG(x) ((x).f_magic != SPARCMAGIC && (x).f_magic != LYNXCOFFMAGIC)
|
|---|
| 32 |
|
|---|
| 33 | /* The page size is a guess based on ELF. */
|
|---|
| 34 | #define COFF_PAGE_SIZE 0x10000
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 | static reloc_howto_type *coff_sparc_reloc_type_lookup
|
|---|
| 38 | PARAMS ((bfd *, bfd_reloc_code_real_type));
|
|---|
| 39 | static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
|
|---|
| 40 |
|
|---|
| 41 | enum reloc_type
|
|---|
| 42 | {
|
|---|
| 43 | R_SPARC_NONE = 0,
|
|---|
| 44 | R_SPARC_8, R_SPARC_16, R_SPARC_32,
|
|---|
| 45 | R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32,
|
|---|
| 46 | R_SPARC_WDISP30, R_SPARC_WDISP22,
|
|---|
| 47 | R_SPARC_HI22, R_SPARC_22,
|
|---|
| 48 | R_SPARC_13, R_SPARC_LO10,
|
|---|
| 49 | R_SPARC_GOT10, R_SPARC_GOT13, R_SPARC_GOT22,
|
|---|
| 50 | R_SPARC_PC10, R_SPARC_PC22,
|
|---|
| 51 | R_SPARC_WPLT30,
|
|---|
| 52 | R_SPARC_COPY,
|
|---|
| 53 | R_SPARC_GLOB_DAT, R_SPARC_JMP_SLOT,
|
|---|
| 54 | R_SPARC_RELATIVE,
|
|---|
| 55 | R_SPARC_UA32,
|
|---|
| 56 | R_SPARC_max
|
|---|
| 57 | };
|
|---|
| 58 |
|
|---|
| 59 | #if 0
|
|---|
| 60 | static const char *const reloc_type_names[] =
|
|---|
|
|---|