diff options
author | Jeff Law <law@redhat.com> | 1996-07-30 20:16:27 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1996-07-30 20:16:27 +0000 |
commit | ad240a828950a0981137ffc09887ef915e711a18 (patch) | |
tree | bf217c780ec556cbbd3d3a65a8207c0421702462 /bfd/som.c | |
parent | 2ed9fe477a037a213abb0010f16488f3f7f8d6fc (diff) | |
download | gdb-ad240a828950a0981137ffc09887ef915e711a18.zip gdb-ad240a828950a0981137ffc09887ef915e711a18.tar.gz gdb-ad240a828950a0981137ffc09887ef915e711a18.tar.bz2 |
* libhppa.h (R_HPPA_ESEL): New field selector.
(e_esel): Similarly.
* som.c (hppa_som_gen_reloc_type): If we encounter an e_esel,
then generate R_COMP2 (PUSH_SYM), R_DATA_EXPR fixup stream.
(som_write_fixups): Handle R_DATA_EXPR just like R_CODE_EXPR.
Making another stab at EH support on the PA.
Diffstat (limited to 'bfd/som.c')
-rw-r--r-- | bfd/som.c | 39 |
1 files changed, 37 insertions, 2 deletions
@@ -1585,6 +1585,15 @@ hppa_som_gen_reloc_type (abfd, base_type, format, field, sym_diff) final_types[5] = NULL; break; } + else if (field == e_esel) + { + final_types[0] = (int *)bfd_alloc_by_size_t (abfd, sizeof (int)); + *final_types[0] = R_COMP2; + final_types[1] = final_type; + *final_types[1] = R_DATA_EXPR; + final_types[2] = NULL; + break;; + } /* PLABELs get their own relocation type. */ else if (field == e_psel || field == e_lpsel @@ -2631,8 +2640,6 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) later relocation. */ switch (bfd_reloc->howto->type) { - /* This only needs to handle relocations that may be - made by hppa_som_gen_reloc. */ case R_ENTRY: case R_ALT_ENTRY: case R_EXIT: @@ -2647,6 +2654,8 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) case R_COMP2: case R_BEGIN_BRTAB: case R_END_BRTAB: + case R_BEGIN_TRY: + case R_END_TRY: case R_N0SEL: case R_N1SEL: reloc_offset = bfd_reloc->address; @@ -2780,6 +2789,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) case R_RSEL: case R_BEGIN_BRTAB: case R_END_BRTAB: + case R_BEGIN_TRY: case R_N0SEL: case R_N1SEL: bfd_put_8 (abfd, bfd_reloc->howto->type, p); @@ -2787,6 +2797,29 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) p += 1; break; + case R_END_TRY: + /* The end of a exception handling region. The reloc's + addend contains the offset of the exception handling + code. */ + if (bfd_reloc->addend == 0) + bfd_put_8 (abfd, bfd_reloc->howto->type, p); + else if (bfd_reloc->addend < 1024) + { + bfd_put_8 (abfd, bfd_reloc->howto->type + 1, p); + bfd_put_8 (abfd, bfd_reloc->addend / 4, p + 1); + p = try_prev_fixup (abfd, &subspace_reloc_size, + p, 2, reloc_queue); + } + else + { + bfd_put_8 (abfd, bfd_reloc->howto->type + 2, p); + bfd_put_8 (abfd, (bfd_reloc->addend / 4) >> 16, p + 1); + bfd_put_16 (abfd, bfd_reloc->addend / 4, p + 2); + p = try_prev_fixup (abfd, &subspace_reloc_size, + p, 4, reloc_queue); + } + break; + case R_COMP1: /* The only time we generate R_COMP1, R_COMP2 and R_CODE_EXPR relocs is for the difference of two @@ -2810,6 +2843,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) break; case R_CODE_EXPR: + case R_DATA_EXPR: /* The only time we generate R_COMP1, R_COMP2 and R_CODE_EXPR relocs is for the difference of two symbols. Hence we can cheat here. */ @@ -4625,6 +4659,7 @@ som_slurp_reloc_table (abfd, section, symbols, just_count) /* We're done with the external relocations. Free them. */ free (external_relocs); + som_section_data (section)->reloc_stream = NULL; /* Save our results and return success. */ section->relocation = internal_relocs; |