* bfd-in2.h: Rebuilt.

* elf32-hppa.c: Change .hppa_linker_stubs to .PARISC.stubs,
	likewise for other PA specific sections.
	(hppa_elf_relocate_unwind_table): Delete unused
	function.
	(elf_hppa_howto_table): Completely new table based on 94-02-02
	draft PA ELF spec.  Change relocation tags appropriately
	throughout elf32-hppa.c
	(hppa_elf_gen_reloc_type): Rewrite and simplify based on 94-02-02
	spec.
	(hppa_elf_reloc): Likewise.
	(hppa_look_for_stubs_in_section): Likewise
	(ELF_MACHINE_CODE): Change to EM_PARISC.
	* elf32-hppa.h: Include "elf/hppa.h".  Change relocation tags
	appropriately throughout elf32-hppa.h.
	(elf32_hppa_reloc_type): New table based on 94-02-02 draft PA ELF
	spec.
	(R_HPPA_ABS_CALL, R_HPPA_COMPLEX*, R_HPPA_UNWIND): Delete definitions.
	* elfcode.h (prep_headers): Use EM_PARISC instead of EM_HPPA.
	* reloc.c (bfd_reloc_code_real): Delete unused HPPA relocations.
	* som.h (R_HPPA_ABS_CALL, R_HPPA_COMPLEX): Delete definitions.

	* libhppa.h (hppa_field_adjust): Avoid adding constant_value into
	the final value twice for LR and RR field selectors.
This commit is contained in:
Jeff Law 1994-05-16 19:34:13 +00:00
parent 3315c7c714
commit 459ae909b9
6 changed files with 545 additions and 1298 deletions

View File

@ -1,5 +1,28 @@
Mon May 16 10:09:22 1994 Jeff Law (law@snake.cs.utah.edu)
* bfd-in2.h: Rebuilt.
* elf32-hppa.c: Change .hppa_linker_stubs to .PARISC.stubs,
likewise for other PA specific sections.
(hppa_elf_relocate_unwind_table): Delete unused
function.
(elf_hppa_howto_table): Completely new table based on 94-02-02
draft PA ELF spec. Change relocation tags appropriately
throughout elf32-hppa.c
(hppa_elf_gen_reloc_type): Rewrite and simplify based on 94-02-02
spec.
(hppa_elf_reloc): Likewise.
(hppa_look_for_stubs_in_section): Likewise
(ELF_MACHINE_CODE): Change to EM_PARISC.
* elf32-hppa.h: Include "elf/hppa.h". Change relocation tags
appropriately throughout elf32-hppa.h.
(elf32_hppa_reloc_type): New table based on 94-02-02 draft PA ELF
spec.
(R_HPPA_ABS_CALL, R_HPPA_COMPLEX*, R_HPPA_UNWIND): Delete definitions.
* elfcode.h (prep_headers): Use EM_PARISC instead of EM_HPPA.
* reloc.c (bfd_reloc_code_real): Delete unused HPPA relocations.
* som.h (R_HPPA_ABS_CALL, R_HPPA_COMPLEX): Delete definitions.
* libhppa.h (hppa_field_adjust): Avoid adding constant_value into
the final value twice for LR and RR field selectors.

View File

@ -1377,103 +1377,6 @@ typedef enum bfd_reloc_code_real
BFD_RELOC_MIPS_CALL16,
#define BFD_RELOC_MIPS_GPREL32 BFD_RELOC_GPREL32
/* These are, so far, specific to HPPA processors. I'm not sure that some
don't duplicate other reloc types, such as BFD_RELOC_32 and _32_PCREL.
Also, many more were in the list I got that don't fit in well in the
model BFD uses, so I've omitted them for now. If we do make this reloc
type get used for code that really does implement the funky reloc types,
they'll have to be added to this list. */
BFD_RELOC_HPPA_32,
BFD_RELOC_HPPA_11,
BFD_RELOC_HPPA_14,
BFD_RELOC_HPPA_17,
BFD_RELOC_HPPA_L21,
BFD_RELOC_HPPA_R11,
BFD_RELOC_HPPA_R14,
BFD_RELOC_HPPA_R17,
BFD_RELOC_HPPA_LS21,
BFD_RELOC_HPPA_RS11,
BFD_RELOC_HPPA_RS14,
BFD_RELOC_HPPA_RS17,
BFD_RELOC_HPPA_LD21,
BFD_RELOC_HPPA_RD11,
BFD_RELOC_HPPA_RD14,
BFD_RELOC_HPPA_RD17,
BFD_RELOC_HPPA_LR21,
BFD_RELOC_HPPA_RR14,
BFD_RELOC_HPPA_RR17,
BFD_RELOC_HPPA_GOTOFF_11,
BFD_RELOC_HPPA_GOTOFF_14,
BFD_RELOC_HPPA_GOTOFF_L21,
BFD_RELOC_HPPA_GOTOFF_R11,
BFD_RELOC_HPPA_GOTOFF_R14,
BFD_RELOC_HPPA_GOTOFF_LS21,
BFD_RELOC_HPPA_GOTOFF_RS11,
BFD_RELOC_HPPA_GOTOFF_RS14,
BFD_RELOC_HPPA_GOTOFF_LD21,
BFD_RELOC_HPPA_GOTOFF_RD11,
BFD_RELOC_HPPA_GOTOFF_RD14,
BFD_RELOC_HPPA_GOTOFF_LR21,
BFD_RELOC_HPPA_GOTOFF_RR14,
BFD_RELOC_HPPA_DLT_32,
BFD_RELOC_HPPA_DLT_11,
BFD_RELOC_HPPA_DLT_14,
BFD_RELOC_HPPA_DLT_L21,
BFD_RELOC_HPPA_DLT_R11,
BFD_RELOC_HPPA_DLT_R14,
BFD_RELOC_HPPA_ABS_CALL_11,
BFD_RELOC_HPPA_ABS_CALL_14,
BFD_RELOC_HPPA_ABS_CALL_17,
BFD_RELOC_HPPA_ABS_CALL_L21,
BFD_RELOC_HPPA_ABS_CALL_R11,
BFD_RELOC_HPPA_ABS_CALL_R14,
BFD_RELOC_HPPA_ABS_CALL_R17,
BFD_RELOC_HPPA_ABS_CALL_LS21,
BFD_RELOC_HPPA_ABS_CALL_RS11,
BFD_RELOC_HPPA_ABS_CALL_RS14,
BFD_RELOC_HPPA_ABS_CALL_RS17,
BFD_RELOC_HPPA_ABS_CALL_LD21,
BFD_RELOC_HPPA_ABS_CALL_RD11,
BFD_RELOC_HPPA_ABS_CALL_RD14,
BFD_RELOC_HPPA_ABS_CALL_RD17,
BFD_RELOC_HPPA_ABS_CALL_LR21,
BFD_RELOC_HPPA_ABS_CALL_RR14,
BFD_RELOC_HPPA_ABS_CALL_RR17,
BFD_RELOC_HPPA_PCREL_CALL_11,
BFD_RELOC_HPPA_PCREL_CALL_12,
BFD_RELOC_HPPA_PCREL_CALL_14,
BFD_RELOC_HPPA_PCREL_CALL_17,
BFD_RELOC_HPPA_PCREL_CALL_L21,
BFD_RELOC_HPPA_PCREL_CALL_R11,
BFD_RELOC_HPPA_PCREL_CALL_R14,
BFD_RELOC_HPPA_PCREL_CALL_R17,
BFD_RELOC_HPPA_PCREL_CALL_LS21,
BFD_RELOC_HPPA_PCREL_CALL_RS11,
BFD_RELOC_HPPA_PCREL_CALL_RS14,
BFD_RELOC_HPPA_PCREL_CALL_RS17,
BFD_RELOC_HPPA_PCREL_CALL_LD21,
BFD_RELOC_HPPA_PCREL_CALL_RD11,
BFD_RELOC_HPPA_PCREL_CALL_RD14,
BFD_RELOC_HPPA_PCREL_CALL_RD17,
BFD_RELOC_HPPA_PCREL_CALL_LR21,
BFD_RELOC_HPPA_PCREL_CALL_RR14,
BFD_RELOC_HPPA_PCREL_CALL_RR17,
BFD_RELOC_HPPA_PLABEL_32,
BFD_RELOC_HPPA_PLABEL_11,
BFD_RELOC_HPPA_PLABEL_14,
BFD_RELOC_HPPA_PLABEL_L21,
BFD_RELOC_HPPA_PLABEL_R11,
BFD_RELOC_HPPA_PLABEL_R14,
BFD_RELOC_HPPA_UNWIND_ENTRY,
BFD_RELOC_HPPA_UNWIND_ENTRIES,
/* i386/elf relocations */
BFD_RELOC_386_GOT32,
BFD_RELOC_386_PLT32,

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
in the Stratus FTX/Golf Object File Format (SED-1762) dated
November 19, 1992.
Copyright (C) 1990-1991 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Written by:
@ -33,248 +33,97 @@
#include "libelf.h"
#include "libhppa.h"
#include "elf/hppa.h"
/* ELF/HPPA relocation types */
typedef enum
{
/* 9.3.4. Address relocation types
These relocation types do simple base + offset relocations.
/* Address relocation types
These relocation types do simple base + offset relocations. */
By convention, relocation type zero is always "no relocation",
while type one is 32-bit word relocation. */
R_PARISC_NONE = 0x00,
R_PARISC_DIR32 = 0x01,
R_PARISC_DIR21L = 0x02,
R_PARISC_DIR17R = 0x03,
R_PARISC_DIR17F = 0x04,
R_PARISC_DIR14R = 0x06,
R_HPPA_NONE, /* - - */
R_HPPA_32, /* Symbol + Addend 32 */
R_HPPA_11, /* Symbol + Addend 11 */
R_HPPA_14, /* Symbol + Addend 11 */
R_HPPA_17, /* Symbol + Addend 11 */
R_HPPA_L21, /* L (Symbol, Addend) 21 */
R_HPPA_R11, /* R (Symbol, Addend) 11 */
R_HPPA_R14, /* R (Symbol, Addend) 14 */
R_HPPA_R17, /* R (Symbol, Addend) 17 */
R_HPPA_LS21, /* LS(Symbol, Addend) 21 */
R_HPPA_RS11, /* RS(Symbol, Addend) 11 */
R_HPPA_RS14, /* RS(Symbol, Addend) 14 */
R_HPPA_RS17, /* RS(Symbol, Addend) 17 */
R_HPPA_LD21, /* LD(Symbol, Addend) 21 */
R_HPPA_RD11, /* RD(Symbol, Addend) 11 */
R_HPPA_RD14, /* RD(Symbol, Addend) 14 */
R_HPPA_RD17, /* RD(Symbol, Addend) 17 */
R_HPPA_LR21, /* LR(Symbol, Addend) 21 */
R_HPPA_RR14, /* RR(Symbol, Addend) 14 */
R_HPPA_RR17, /* RR(Symbol, Addend) 17 */
/* PC-relative relocation types
Typically used for calls.
Note PCREL17C and PCREL17F differ only in overflow handling.
PCREL17C never reports a relocation error.
/* 9.3.5. GOTOFF address relocation types
The Global Offset Table (GOT) is a table of pointers to data, but
its address can also be used as a base pointer to address data,
similar to the way the DP is used in HP/UX. The expression
calculation yields a signed offset of an address from the GOT. */
R_HPPA_GOTOFF_11, /* Symbol - GOT + Addend 11 */
R_HPPA_GOTOFF_14, /* Symbol - GOT + Addend 14 */
R_HPPA_GOTOFF_L21, /* L (Sym - GOT, Addend) 21 */
R_HPPA_GOTOFF_R11, /* R (Sym - GOT, Addend) 11 */
R_HPPA_GOTOFF_R14, /* R (Sym - GOT, Addend) 14 */
R_HPPA_GOTOFF_LS21, /* LS(Sym - GOT, Addend) 21 */
R_HPPA_GOTOFF_RS11, /* RS(Sym - GOT, Addend) 11 */
R_HPPA_GOTOFF_RS14, /* RS(Sym - GOT, Addend) 14 */
R_HPPA_GOTOFF_LD21, /* LD(Sym - GOT, Addend) 21 */
R_HPPA_GOTOFF_RD11, /* RD(Sym - GOT, Addend) 11 */
R_HPPA_GOTOFF_RD14, /* RD(Sym - GOT, Addend) 14 */
R_HPPA_GOTOFF_LR21, /* LR(Sym - GOT, Addend) 21 */
R_HPPA_GOTOFF_RR14, /* RR(Sym - GOT, Addend) 14 */
/* 9.3.6. Absolute call relocation types
Relocations of function calls must be accompanied by parameter
relocation information. This information is carried in the ten
high-order bits of the addend field. The remaining 22 bits of
of the addend field are sign-extended to form the Addend.
When supporting argument relocations, function calls must be
accompanied by parameter relocation information. This information is
carried in the ten high-order bits of the addend field. The remaining
22 bits of of the addend field are sign-extended to form the Addend.
Note the code to build argument relocations depends on the
addend being zero. A consequence of this limitation is GAS
can not perform relocation reductions for function symbols. */
R_PARISC_PCREL21L = 0x0a,
R_PARISC_PCREL17R = 0x0b,
R_PARISC_PCREL17F = 0x0c,
R_PARISC_PCREL17C = 0x0d,
R_PARISC_PCREL14R = 0x0e,
R_PARISC_PCREL14F = 0x0f,
R_HPPA_ABS_CALL_11, /* Symbol + Addend 11 */
R_HPPA_ABS_CALL_14, /* Symbol + Addend 14 */
R_HPPA_ABS_CALL_17, /* Symbol + Addend 17 */
R_HPPA_ABS_CALL_L21, /* L (Symbol, Addend) 21 */
R_HPPA_ABS_CALL_R11, /* R (Symbol, Addend) 11 */
R_HPPA_ABS_CALL_R14, /* R (Symbol, Addend) 14 */
R_HPPA_ABS_CALL_R17, /* R (Symbol, Addend) 17 */
R_HPPA_ABS_CALL_LS21, /* LS(Symbol, Addend) 21 */
R_HPPA_ABS_CALL_RS11, /* RS(Symbol, Addend) 11 */
R_HPPA_ABS_CALL_RS14, /* RS(Symbol, Addend) 14 */
R_HPPA_ABS_CALL_RS17, /* RS(Symbol, Addend) 17 */
R_HPPA_ABS_CALL_LD21, /* LD(Symbol, Addend) 21 */
R_HPPA_ABS_CALL_RD11, /* RD(Symbol, Addend) 11 */
R_HPPA_ABS_CALL_RD14, /* RD(Symbol, Addend) 14 */
R_HPPA_ABS_CALL_RD17, /* RD(Symbol, Addend) 17 */
R_HPPA_ABS_CALL_LR21, /* LR(Symbol, Addend) 21 */
R_HPPA_ABS_CALL_RR14, /* RR(Symbol, Addend) 14 */
R_HPPA_ABS_CALL_RR17, /* RR(Symbol, Addend) 17 */
/* DP-relative relocation types. */
R_PARISC_DPREL21L = 0x12,
R_PARISC_DPREL14R = 0x16,
R_PARISC_DPREL14F = 0x17,
/* 9.3.7. PC-relative call relocation types
PC-relative relocation calculates the difference between an address
and the location being relocated. This is most often used to
relocate pc-relative calls. They are otherwise identical to
their corresponding absolute call relocations. */
R_HPPA_PCREL_CALL_11, /* Symbol - PC + Addend 11 */
R_HPPA_PCREL_CALL_14, /* Symbol - PC + Addend 14 */
R_HPPA_PCREL_CALL_17, /* Symbol - PC + Addend 17 */
R_HPPA_PCREL_CALL_12, /* Symbol - PC + Addend 12 */
R_HPPA_PCREL_CALL_L21, /* L (Symbol - PC, Addend) 21 */
R_HPPA_PCREL_CALL_R11, /* R (Symbol - PC, Addend) 11 */
R_HPPA_PCREL_CALL_R14, /* R (Symbol - PC, Addend) 14 */
R_HPPA_PCREL_CALL_R17, /* R (Symbol - PC, Addend) 17 */
R_HPPA_PCREL_CALL_LS21, /* LS(Symbol - PC, Addend) 21 */
R_HPPA_PCREL_CALL_RS11, /* RS(Symbol - PC, Addend) 11 */
R_HPPA_PCREL_CALL_RS14, /* RS(Symbol - PC, Addend) 14 */
R_HPPA_PCREL_CALL_RS17, /* RS(Symbol - PC, Addend) 17 */
R_HPPA_PCREL_CALL_LD21, /* LD(Symbol - PC, Addend) 21 */
R_HPPA_PCREL_CALL_RD11, /* RD(Symbol - PC, Addend) 11 */
R_HPPA_PCREL_CALL_RD14, /* RD(Symbol - PC, Addend) 14 */
R_HPPA_PCREL_CALL_RD17, /* RD(Symbol - PC, Addend) 17 */
R_HPPA_PCREL_CALL_LR21, /* LR(Symbol - PC, Addend) 21 */
R_HPPA_PCREL_CALL_RR14, /* RR(Symbol - PC, Addend) 14 */
R_HPPA_PCREL_CALL_RR17, /* RR(Symbol - PC, Addend) 17 */
/* 9.3.8. Plabel relocation types
Plabels are designed to allow code pointers to be passed between
spaces.
Plabels are procedure markers. They are used to denote relocations
which involve procedures (call, loading the address of a procedure,
etc). They are necessary for the proper functioning of argument
relocations. The addend of the relocation should be either 0 (no
static link) or 2 (static link required). These relocations
correspond to the P%, LP% and RP% field selectors. */
R_HPPA_PLABEL_32, /* F(Plabel(Symbol,Addend),0) 32 */
R_HPPA_PLABEL_11, /* F(Plabel(Symbol,Addend),0) 11 */
R_HPPA_PLABEL_14, /* F(Plabel(Symbol,Addend),0) 14 */
R_HPPA_PLABEL_L21, /* L(Plabel(Symbol,Addend),0) 21 */
R_HPPA_PLABEL_R11, /* R(Plabel(Symbol,Addend),0) 11 */
R_HPPA_PLABEL_R14, /* R(Plabel(Symbol,Addend),0) 14 */
/* 9.3.9. Data linkage table (DLT) relocation types
/* Data linkage table (DLT) relocation types
SOM DLT_REL fixup requests are used to for static data references
from position-independent code within shared libraries. They are
similar to the GOT relocation types in some SVR4 implementations. */
R_HPPA_DLT_32, /* F(DLTOFF) 32 */
R_HPPA_DLT_11, /* F(DLTOFF) 11 */
R_HPPA_DLT_14, /* F(DLTOFF) 14 */
R_HPPA_DLT_L21, /* L(DLTOFF) 21 */
R_HPPA_DLT_R11, /* R(DLTOFF) 11 */
R_HPPA_DLT_R14, /* R(DLTOFF) 14 */
R_PARISC_DLTREL21L = 0x1a,
R_PARISC_DLTREL14R = 0x1e,
R_PARISC_DLTREL14F = 0x1f,
/* 9.3.10. Relocations for unwinder tables
/* DLT indirect relocation types */
R_PARISC_DLTIND21L = 0x22,
R_PARISC_DLTIND14R = 0x26,
R_PARISC_DLTIND14F = 0x27,
The unwinder table consists of a series of four-word entries, the
first two of which are a pair of code addresses. While it would be
possible to relocate this table using just R_HPPA_32, the amount of
relocation data resulting would be very large. To reduce that data,
the following relocation types have been defined.
/* Base relative relocation types. Ugh. These imply lots of state */
R_PARISC_SETBASE = 0x28,
R_PARISC_BASEREL32 = 0x29,
R_PARISC_BASEREL21L = 0x2a,
R_PARISC_BASEREL17R = 0x2b,
R_PARISC_BASEREL17F = 0x2c,
R_PARISC_BASEREL14R = 0x2e,
R_PARISC_BASEREL14F = 0x2f,
The first, R_HPPA_UNWIND_ENTRY, merely compresses two R_HPPA_32
operations into one. It is designed for use in .rel-type
relocations, where the two 32-bit addends are taken from the unwind
section itself.
/* Segment relative relocation types. */
R_PARISC_TEXTREL32 = 0x31,
R_PARISC_DATAREL32 = 0x39,
The second, which is designed for use in .rela-type relocations, is
designed to relocate an entire unwinder table with one relocation
entry. It has the effect of multiple R_HPPA_UNWIND_ENTRY
relocations applied to successive unwinder table entries. The
number of entries to be relocated is given in the r_addend field of
the relocation entry. The rest of the relocation entry is used in
a normal way--r_offset is the offset of the first unwind entry in
the section, while ELF32_R_SYM(r_info) is the code section that all
the code addresses should be relocated from.
/* Plabel relocation types. */
R_PARISC_PLABEL32 = 0x41,
R_PARISC_PLABEL21L = 0x42,
R_PARISC_PLABEL14R = 0x46,
Why can't we use begin/end markers + unwind description bits like
som? FIXME! */
R_HPPA_UNWIND_ENTRY, /* "128" */
R_HPPA_UNWIND_ENTRIES, /* Addend * "128" */
/* PLT relocations. */
R_PARISC_PLTIND21L = 0x82,
R_PARISC_PLTIND14R = 0x86,
R_PARISC_PLTIND14F = 0x87,
/* 9.3.11. Relocation types for complex expressions
New-format SOM fixups support complex expressions by spreading
the parts of the expression across multiple entries. ELF for
HPPA will have a similar mechanism, although support for it may
be optional. There are two main reasons for defining it: first,
the need to translate complex SOM fixup expressions to ELF, and
second, to cover combinations of expression, field and format not
available with other relocation types.
ELF expression relocation entries are interpreted as postfix-form
expressions. They may be evaluated using a push-down stack.
Usually, the addend field of these expression relocation entries is
unused, with the following exceptions:
R_HPPA_PUSH_CONST: The addend field contains the constant.
R_HPPA_PUSH_PROC: The high-order 10 bits of the addend field
contain parameter relocation information. The rest ofthe addend
field is unused.
R_HPPA_LSHIFT, R_HPPA_ARITH_RSHIFT and R_HPPA_LOGIC_RSHIFT:
The addend field normally gives the amount to shift.
However, if that amount is zero, the shift amount is
popped from the top of the stack prior to popping the
amount to be shifted. */
R_HPPA_PUSH_CONST, /* push Addend - - */
R_HPPA_PUSH_PC, /* push PC + Addend - - */
R_HPPA_PUSH_SYM, /* push Symbol + Addend - - */
R_HPPA_PUSH_GOTOFF, /* push Symbol - GOT + Addend - - */
R_HPPA_PUSH_ABS_CALL, /* push Symbol + Addend - - */
R_HPPA_PUSH_PCREL_CALL, /* push Symbol - PC + Addend - - */
R_HPPA_PUSH_PLABEL, /* push Plabel(Symbol) - - */
R_HPPA_MAX, /* pop A and B, push max(B,A) - - */
R_HPPA_MIN, /* pop A and B, push min(B,A) - - */
R_HPPA_ADD, /* pop A and B, push B + A - - */
R_HPPA_SUB, /* pop A and B, push B - A - - */
R_HPPA_MULT, /* pop A and B, push B * A - - */
R_HPPA_DIV, /* pop A and B, push B / A - - */
R_HPPA_MOD, /* pop A and B, push B % A - - */
R_HPPA_AND, /* pop A and B, push B & A - - */
R_HPPA_OR, /* pop A and B, push B | A - - */
R_HPPA_XOR, /* pop A and B, push B ^ A - - */
R_HPPA_NOT, /* pop A, push ~A - - */
R_HPPA_LSHIFT, /* pop A, push A << Addend - - */
R_HPPA_ARITH_RSHIFT, /* pop A, push A >> Addend - - */
R_HPPA_LOGIC_RSHIFT, /* pop A, push A >> Addend - - */
R_HPPA_EXPR_F, /* pop A, push A + Addend F - */
R_HPPA_EXPR_L, /* pop A, push L(A,Addend) L - */
R_HPPA_EXPR_R, /* pop A, push R(A,Addend) R - */
R_HPPA_EXPR_LS, /* pop A, push LS(A,Addend) LS - */
R_HPPA_EXPR_RS, /* pop A, push RS(A,Addend) RS - */
R_HPPA_EXPR_LD, /* pop A, push LD(A,Addend) LD - */
R_HPPA_EXPR_RD, /* pop A, push RD(A,Addend) RD - */
R_HPPA_EXPR_LR, /* pop A, push LR(A,Addend) LR - */
R_HPPA_EXPR_RR, /* pop A, push RR(A,Addend) RR - */
R_HPPA_EXPR_32, /* pop - 32 */
R_HPPA_EXPR_21, /* pop - 21 */
R_HPPA_EXPR_11, /* pop - 11 */
R_HPPA_EXPR_14, /* pop - 14 */
R_HPPA_EXPR_17, /* pop - 17 */
R_HPPA_EXPR_12, /* pop - 12 */
R_HPPA_STUB_CALL_17, /* Symbol + Addend - 17 */
R_HPPA_UNIMPLEMENTED /* N/A */
/* Misc relocation types. */
R_PARISC_COPY = 0x88,
R_PARISC_GLOB_DAT = 0x89,
R_PARISC_JMP_SLOT = 0x8a,
R_PARISC_RELATIVE = 0x8b,
R_PARISC_STUB_CALL_17 = 0x8c,
R_PARISC_UNIMPLEMENTED,
}
elf32_hppa_reloc_type;
#define ELF_HOWTO_TABLE_SIZE R_HPPA_UNIMPLEMENTED + 1
#define N_HPPA_RELOCS R_HPPA_UNIMPLEMENTED + 1
#define ELF_HOWTO_TABLE_SIZE R_PARISC_UNIMPLEMENTED + 1
#define N_PARISC_RELOCS R_PARISC_UNIMPLEMENTED + 1
/* Define groups of basic relocations. FIXME: These should
be the only basic relocations created by GAS. The rest
@ -285,40 +134,28 @@ elf32_hppa_reloc_type;
as appropriate. This allows GAS to share much more code
between the two target object formats. */
#define R_HPPA R_HPPA_32
#define R_HPPA_GOTOFF R_HPPA_GOTOFF_11
#define R_HPPA_ABS_CALL R_HPPA_ABS_CALL_11
#define R_HPPA_PCREL_CALL R_HPPA_PCREL_CALL_11
#define R_HPPA_PLABEL R_HPPA_PLABEL_32
#define R_HPPA_DLT R_HPPA_DLT_32
#define R_HPPA_UNWIND R_HPPA_UNWIND_ENTRY
#define R_HPPA_COMPLEX R_HPPA_PUSH_CONST
#define R_HPPA_COMPLEX_PCREL_CALL R_HPPA_PUSH_CONST + 1
#define R_HPPA_COMPLEX_ABS_CALL R_HPPA_PUSH_CONST + 2
/* HPPA Section types */
#define SHT_HPPA_SYMEXTN SHT_LOPROC
/* HPPA Symbol types */
#define STT_HPPA_PLABEL STT_LOPROC
#define R_HPPA_NONE R_PARISC_NONE
#define R_HPPA R_PARISC_DIR32
#define R_HPPA_GOTOFF R_PARISC_DPREL21L
#define R_HPPA_PCREL_CALL R_PARISC_PCREL21L
/* HPPA symbol table extension entry types */
enum elf32_hppa_symextn_types
{
HPPA_SXT_NULL,
HPPA_SXT_SYMNDX,
HPPA_SXT_ARG_RELOC,
PARISC_SXT_NULL,
PARISC_SXT_SYMNDX,
PARISC_SXT_ARG_RELOC,
};
/* These macros compose and decompose the value of a symextn entry:
entry_type = ELF32_HPPA_SX_TYPE(word);
entry_value = ELF32_HPPA_SX_VAL(word);
word = ELF32_HPPA_SX_WORD(type,val); */
entry_type = ELF32_PARISC_SX_TYPE(word);
entry_value = ELF32_PARISC_SX_VAL(word);
word = ELF32_PARISC_SX_WORD(type,val); */
#define ELF32_HPPA_SX_TYPE(p) ((p) >> 24)
#define ELF32_HPPA_SX_VAL(p) ((p) & 0xFFFFFF)
#define ELF32_HPPA_SX_WORD(type,val) (((type) << 24) + (val & 0xFFFFFF))
#define ELF32_PARISC_SX_TYPE(p) ((p) >> 24)
#define ELF32_PARISC_SX_VAL(p) ((p) & 0xFFFFFF)
#define ELF32_PARISC_SX_WORD(type,val) (((type) << 24) + (val & 0xFFFFFF))
/* The following was added facilitate implementation of the .hppa_symextn
section. This section is built after the symbol table is built in the
@ -329,7 +166,7 @@ enum elf32_hppa_symextn_types
/* Number of "hand-made" target specific sections. */
#define ELF_TC_FAKE_SECTIONS 1
#define SYMEXTN_SECTION_NAME ".hppa_symextn"
#define SYMEXTN_SECTION_NAME ".PARISC.symext"
/* FIXME. Are these external? (For example used by GAS?). If so the
names need to change to avoid namespace pollution, if not they should
@ -343,9 +180,6 @@ struct symext_chain
typedef struct symext_chain symext_chainS;
void elf_hppa_tc_symbol
PARAMS ((bfd *, elf_symbol_type *, int, symext_chainS **, symext_chainS **));
elf32_hppa_reloc_type **hppa_elf_gen_reloc_type
PARAMS ((bfd *, elf32_hppa_reloc_type, int, int));
@ -354,6 +188,4 @@ asymbol * hppa_look_for_stubs_in_section
int *, struct bfd_link_info *));
void elf_hppa_final_processing PARAMS ((void));
void elf_hppa_tc_make_sections PARAMS ((bfd *, symext_chainS *));
#endif /* _ELF32_HPPA_H */

View File

@ -2052,18 +2052,6 @@ assign_file_positions_except_relocs (abfd, dosyms)
}
off = assign_file_position_for_section (i_shdrp, off);
if (exec_p
&& i_shdrp->sh_type == SHT_NOBITS
&& (i == i_ehdrp->e_shnum
|| i_shdrpp[i + 1]->sh_type != SHT_NOBITS))
{
/* Skip to the next page to ensure that when the file is
loaded the bss section is loaded with zeroes. I don't
know if this is required on all platforms, but it
shouldn't really hurt. */
off = BFD_ALIGN (off, maxpagesize);
}
if (exec_p
&& (abfd->flags & D_PAGED) != 0
&& get_elf_backend_data (abfd)->maxpagesize > 1
@ -2161,7 +2149,7 @@ prep_headers (abfd)
i_ehdrp->e_machine = EM_MIPS; /* only MIPS R3000 */
break;
case bfd_arch_hppa:
i_ehdrp->e_machine = EM_HPPA;
i_ehdrp->e_machine = EM_PARISC;
break;
case bfd_arch_powerpc:
i_ehdrp->e_machine = EM_CYGNUS_POWERPC;

View File

@ -127,27 +127,48 @@ struct som_data_struct
struct somdata a;
};
/* Substructure of som_section_data_struct used to hold information
which can't be represented by the generic BFD section structure,
but which must be copied during objcopy or strip. */
struct som_copyable_section_data_struct
{
/* Various fields in space and subspace headers that we need
to pass around. */
unsigned int sort_key : 8;
unsigned int access_control_bits : 7;
unsigned int is_defined : 1;
unsigned int is_private : 1;
unsigned int quadrant : 2;
/* For subspaces, this points to the section which represents the
space in which the subspace is contained. For spaces it points
back to the section for this space. */
asection *container;
/* The user-specified space number. It is wrong to use this as
an index since duplicates and holes are allowed. */
int space_number;
/* Add more stuff here as needed. Good examples of information
we might want to pass would be initialization pointers,
and the many subspace flags we do not represent yet. */
};
/* Used to keep extra SOM specific information for a given section.
reloc_size holds the size of the relocation stream, note this
is very different from the number of relocations as SOM relocations
are variable length.
reloc_stream is the actual stream of relocation entries.
The BFD section index may not exactly match a SOM subspace index,
for this reason we keep track of the original SOM subspace index
when a subspace is turned into a BFD section. */
reloc_stream is the actual stream of relocation entries. */
struct som_section_data_struct
{
unsigned int is_space : 1;
unsigned int is_subspace : 1;
struct som_copyable_section_data_struct *copy_data;
unsigned int reloc_size;
char *reloc_stream;
asection *containing_space;
struct space_dictionary_record space_dict;
struct subspace_dictionary_record subspace_dict;
struct space_dictionary_record *space_dict;
struct subspace_dictionary_record *subspace_dict;
};
#define somdata(bfd) ((bfd)->tdata.som_data->a)
@ -163,8 +184,7 @@ struct som_section_data_struct
#define obj_som_reloc_filepos(bfd) (somdata(bfd).reloc_filepos)
#define som_section_data(sec) \
((struct som_section_data_struct *)sec->used_by_bfd)
#define som_symbol_data(symbol) \
((som_symbol_type *) symbol)
#define som_symbol_data(symbol) ((som_symbol_type *) symbol)
/* Defines groups of basic relocations. FIXME: These should
@ -178,20 +198,16 @@ struct som_section_data_struct
#define R_HPPA_NONE R_NO_RELOCATION
#define R_HPPA R_CODE_ONE_SYMBOL
#define R_HPPA_ABS_CALL R_ABS_CALL
#define R_HPPA_PCREL_CALL R_PCREL_CALL
#define R_HPPA_GOTOFF R_DP_RELATIVE
#define R_HPPA_COMPLEX R_COMP1
#define R_HPPA_COMPLEX_PCREL_CALL R_COMP2
#define R_HPPA_COMPLEX_ABS_CALL R_COMP3
#define R_HPPA_ENTRY R_ENTRY
#define R_HPPA_EXIT R_EXIT
/* Exported functions, mostly for use by GAS. */
void bfd_som_set_section_attributes PARAMS ((asection *, int, int,
unsigned int, int));
void bfd_som_set_subsection_attributes PARAMS ((asection *, asection *,
int, unsigned int, int));
boolean bfd_som_set_section_attributes PARAMS ((asection *, int, int,
unsigned int, int));
boolean bfd_som_set_subsection_attributes PARAMS ((asection *, asection *,
int, unsigned int, int));
void bfd_som_set_symbol_type PARAMS ((asymbol *, unsigned int));
void bfd_som_attach_unwind_info PARAMS ((asymbol *, char *));
boolean bfd_som_attach_aux_hdr PARAMS ((bfd *, int, char *));