aboutsummaryrefslogtreecommitdiff
path: root/bfd/som.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1993-12-14 07:36:15 +0000
committerJeff Law <law@redhat.com>1993-12-14 07:36:15 +0000
commita36b6f1d05754890fe380571cff36c54fcc20065 (patch)
treece574b30fd13dcec197ce7b8a0dcde3d37ce7f64 /bfd/som.c
parent9d5a9b20fed1032fe96027b2edb6bef752722ef0 (diff)
downloadgdb-a36b6f1d05754890fe380571cff36c54fcc20065.zip
gdb-a36b6f1d05754890fe380571cff36c54fcc20065.tar.gz
gdb-a36b6f1d05754890fe380571cff36c54fcc20065.tar.bz2
* elf32-hppa.c (hppa_elf_gen_reloc_type): Handle 'T' field
selectors for PIC code. * som.c (hppa_som_gen_reloc_type): Handle 'T' field selectors. (som_write_fixups): Handle R_DLT_REL, R_FSEL, R_RSEL, R_LSEL relocations needed by PIC.
Diffstat (limited to 'bfd/som.c')
-rw-r--r--bfd/som.c46
1 files changed, 35 insertions, 11 deletions
diff --git a/bfd/som.c b/bfd/som.c
index 08ef811..de23ef4 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -1356,11 +1356,18 @@ hppa_som_gen_reloc_type (abfd, base_type, format, field)
case e_psel:
case e_lpsel:
case e_rpsel:
+ final_types[0] = final_type;
+ final_types[1] = NULL;
+ final_types[2] = NULL;
+ *final_type = base_type;
+ break;
+
case e_tsel:
case e_ltsel:
case e_rtsel:
- final_types[0] = final_type;
- final_types[1] = NULL;
+ final_types[0] = (int *) bfd_alloc_by_size_t (abfd, sizeof (int));
+ *final_types[0] = R_FSEL;
+ final_types[1] = final_type;
final_types[2] = NULL;
*final_type = base_type;
break;
@@ -1409,15 +1416,20 @@ hppa_som_gen_reloc_type (abfd, base_type, format, field)
if (field == e_psel
|| field == e_lpsel
|| field == e_rpsel)
- {
- /* A PLABEL relocation that has a size of 32 bits must
- be a R_DATA_PLABEL. All others are R_CODE_PLABELs. */
- if (format == 32)
- *final_type = R_DATA_PLABEL;
- else
- *final_type = R_CODE_PLABEL;
- }
- /* A relocatoin in the data space is always a full 32bits. */
+ {
+ /* A PLABEL relocation that has a size of 32 bits must
+ be a R_DATA_PLABEL. All others are R_CODE_PLABELs. */
+ if (format == 32)
+ *final_type = R_DATA_PLABEL;
+ else
+ *final_type = R_CODE_PLABEL;
+ }
+ /* PIC stuff. */
+ else if (field == e_tsel
+ || field == e_ltsel
+ || field == e_rtsel)
+ *final_type = R_DLT_REL;
+ /* A relocation in the data space is always a full 32bits. */
else if (format == 32)
*final_type = R_DATA_ONE_SYMBOL;
@@ -2197,6 +2209,9 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep)
case R_S_MODE:
case R_D_MODE:
case R_R_MODE:
+ case R_FSEL:
+ case R_LSEL:
+ case R_RSEL:
reloc_offset = bfd_reloc->address;
break;
@@ -2249,6 +2264,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep)
case R_DATA_ONE_SYMBOL:
case R_DATA_PLABEL:
case R_CODE_PLABEL:
+ case R_DLT_REL:
/* Account for any addend. */
if (bfd_reloc->addend)
p = som_reloc_addend (abfd, bfd_reloc->addend, p,
@@ -2306,6 +2322,14 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep)
}
break;
+ case R_FSEL:
+ case R_LSEL:
+ case R_RSEL:
+ bfd_put_8 (abfd, bfd_reloc->howto->type, p);
+ subspace_reloc_size += 1;
+ p += 1;
+ break;
+
/* Put a "R_RESERVED" relocation in the stream if
we hit something we do not understand. The linker
will complain loudly if this ever happens. */