#endif
elf_hppa_reloc_type ** _bfd_elf_hppa_gen_reloc_type
- PARAMS ((bfd *, elf_hppa_reloc_type, int, int, int, asymbol *));
+ PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *));
static void elf_hppa_info_to_howto
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
bfd *abfd;
elf_hppa_reloc_type base_type;
int format;
- int field;
+ unsigned int field;
int ignore ATTRIBUTE_UNUSED;
asymbol *sym ATTRIBUTE_UNUSED;
{
{
case e_lsel:
case e_lrsel:
+ case e_nlsel:
+ case e_nlrsel:
final_type = R_PARISC_DIR21L;
break;
case e_ltsel:
{
case e_rsel:
case e_rrsel:
+ /* R_PARISC_DLTREL14R for elf64, R_PARISC_DPREL14R for elf32 */
final_type = base_type + OFFSET_14R_FROM_21L;
break;
case e_fsel:
+ /* R_PARISC_DLTREL14F for elf64, R_PARISC_DPREL14F for elf32 */
final_type = base_type + OFFSET_14F_FROM_21L;
break;
default:
case 21:
switch (field)
{
- case e_lrsel:
case e_lsel:
+ case e_lrsel:
+ case e_nlsel:
+ case e_nlrsel:
+ /* R_PARISC_DLTREL21L for elf64, R_PARISC_DPREL21L for elf32 */
final_type = base_type;
break;
default:
}
break;
- case 22:
+ case 21:
switch (field)
{
- case e_fsel:
- final_type = R_PARISC_PCREL22F;
+ case e_lsel:
+ case e_lrsel:
+ case e_nlsel:
+ case e_nlrsel:
+ final_type = R_PARISC_PCREL21L;
break;
default:
return NULL;
}
break;
- case 21:
+ case 22:
switch (field)
{
- case e_lsel:
- case e_lrsel:
- final_type = R_PARISC_PCREL21L;
+ case e_fsel:
+ final_type = R_PARISC_PCREL22F;
break;
default:
return NULL;
if (strcmp (name, ".PARISC.unwind") == 0)
{
int indx;
- asection *sec;
+ asection *asec;
#if ARCH_SIZE == 64
hdr->sh_type = SHT_LOPROC + 1;
#else
So we (gasp) recompute it here. Hopefully nobody ever changes the
way sections are numbered in elf.c! */
- for (sec = abfd->sections, indx = 1; sec; sec = sec->next, indx++)
+ for (asec = abfd->sections, indx = 1; asec; asec = asec->next, indx++)
{
- if (sec->name && strcmp (sec->name, ".text") == 0)
+ if (asec->name && strcmp (asec->name, ".text") == 0)
{
hdr->sh_info = indx;
break;
static void
elf_hppa_final_write_processing (abfd, linker)
bfd *abfd;
- boolean linker;
+ boolean linker ATTRIBUTE_UNUSED;
{
int mach = bfd_get_mach (abfd);
value = section->vma - section->filepos;
- if ((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)
+ if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
== (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
&& value < hppa_info->text_segment_base)
hppa_info->text_segment_base = value;
- else if ((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)
- == (SEC_ALLOC | SEC_LOAD))
- && value < hppa_info->data_segment_base)
+ else if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
+ == (SEC_ALLOC | SEC_LOAD))
+ && value < hppa_info->data_segment_base)
hppa_info->data_segment_base = value;
}
struct bfd_link_info *info;
{
boolean retval;
+ struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info);
if (! info->relocateable)
{
struct elf_link_hash_entry *gp;
bfd_vma gp_val;
- struct elf64_hppa_link_hash_table *hppa_info;
-
- hppa_info = elf64_hppa_hash_table (info);
/* The linker script defines a value for __gp iff it was referenced
by one of the objects being linked. First try to find the symbol
/* Adjust the value of __gp as we may want to slide it into the
.plt section so that the stubs can access PLT entries without
using an addil sequence. */
- gp->root.u.def.value += elf64_hppa_hash_table (info)->gp_offset;
+ gp->root.u.def.value += hppa_info->gp_offset;
gp_val = (gp->root.u.def.section->output_section->vma
+ gp->root.u.def.section->output_offset
}
/* We need to know the base of the text and data segments so that we
- can perform SEGREL relocations. We will recore the base addresses
+ can perform SEGREL relocations. We will record the base addresses
when we encounter the first SEGREL relocation. */
- elf64_hppa_hash_table (info)->text_segment_base = (bfd_vma)-1;
- elf64_hppa_hash_table (info)->data_segment_base = (bfd_vma)-1;
+ hppa_info->text_segment_base = (bfd_vma)-1;
+ hppa_info->data_segment_base = (bfd_vma)-1;
/* HP's shared libraries have references to symbols that are not
defined anywhere. The generic ELF BFD linker code will complaim
bfd_vma relocation;
bfd_reloc_status_type r;
const char *sym_name;
- char *dyn_name;
+ const char *dyn_name;
char *dynh_buf = NULL;
size_t dynh_buflen = 0;
struct elf64_hppa_dyn_hash_entry *dyn_h = NULL;
bfd_vma value;
struct bfd_link_info *info;
asection *sym_sec;
- struct elf_link_hash_entry *h;
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED;
struct elf64_hppa_dyn_hash_entry *dyn_h;
{
unsigned int insn;
case R_PARISC_LTOFF16DF:
{
/* If this relocation was against a local symbol, then we still
- have not set up the DLT entry (it's not convienent to do so
+ have not set up the DLT entry (it's not convenient to do so
in the "finalize_dlt" routine because it is difficult to get
to the local symbol's value).
/* Subtract out the global pointer value to make value a DLT
relative address. */
value -= _bfd_get_gp_value (output_bfd);
- value += addend;
bfd_put_64 (input_bfd, value + addend, hit_data);
return bfd_reloc_ok;
value += addend;
value -= 8;
- bfd_put_64 (input_bfd, value, hit_data);
+ bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
}
case R_PARISC_SECREL32:
bfd_put_32 (input_bfd,
- (value + addend
- - sym_sec->output_section->vma),
+ value + addend - sym_sec->output_section->vma,
hit_data);
return bfd_reloc_ok;
the segment base values. */
if (hppa_info->text_segment_base == (bfd_vma) -1)
bfd_map_over_sections (output_bfd, elf_hppa_record_segment_addrs,
- elf64_hppa_hash_table (info));
+ hppa_info);
/* VALUE holds the absolute address. We want to include the
addend, then turn it into a segment relative address.
/* Update the instruction word. */
bfd_put_32 (input_bfd, insn, hit_data);
- return (bfd_reloc_ok);
+ return bfd_reloc_ok;
}
/* Relocate the given INSN. VALUE should be the actual value we want
the "B" instruction. */
case R_PARISC_PCREL22F:
case R_PARISC_PCREL22C:
- return re_assemble_22 (insn & ~ 0x3ff1ffd, sym_value);
+ return (insn & ~ 0x3ff1ffd) | re_assemble_22 (sym_value);
/* This is any 17bit branch. In PA2.0 syntax it also corresponds to
the "B" instruction as well as BE. */
case R_PARISC_DIR17R:
case R_PARISC_PCREL17C:
case R_PARISC_PCREL17R:
- return re_assemble_17 (insn & ~ 0x1f1ffd, sym_value);
+ return (insn & ~ 0x1f1ffd) | re_assemble_17 (sym_value);
/* ADDIL or LDIL instructions. */
case R_PARISC_DLTREL21L:
case R_PARISC_DPREL21L:
case R_PARISC_PLTOFF21L:
case R_PARISC_DIR21L:
- return re_assemble_21 (insn & ~ 0x1fffff, sym_value);
+ return (insn & ~ 0x1fffff) | re_assemble_21 (sym_value);
/* LDO and integer loads/stores with 14bit displacements. */
case R_PARISC_DLTREL14R: