This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
#define ELF_HOWTO_TABLE_SIZE R_PARISC_UNIMPLEMENTED + 1
return NULL;
}
+static reloc_howto_type *
+elf_hppa_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ const char *r_name)
+{
+ unsigned int i;
+
+ for (i = 0;
+ i < sizeof (elf_hppa_howto_table) / sizeof (elf_hppa_howto_table[0]);
+ i++)
+ if (elf_hppa_howto_table[i].name != NULL
+ && strcasecmp (elf_hppa_howto_table[i].name, r_name) == 0)
+ return &elf_hppa_howto_table[i];
+
+ return NULL;
+}
+
/* Return TRUE if SYM represents a local label symbol. */
static bfd_boolean
/* Record the lowest address for the data and text segments. */
static void
-elf_hppa_record_segment_addrs (bfd *abfd ATTRIBUTE_UNUSED,
+elf_hppa_record_segment_addrs (bfd *abfd,
asection *section,
void *data)
{
- struct elf64_hppa_link_hash_table *hppa_info;
- bfd_vma value;
+ struct elf64_hppa_link_hash_table *hppa_info = data;
- hppa_info = data;
+ if ((section->flags & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+ {
+ bfd_vma value;
+ Elf_Internal_Phdr *p;
- value = section->vma - section->filepos;
+ p = _bfd_elf_find_segment_containing_section (abfd, section->output_section);
+ BFD_ASSERT (p != NULL);
+ value = p->p_vaddr;
- 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)
- hppa_info->data_segment_base = value;
+ if (section->flags & SEC_READONLY)
+ {
+ if (value < hppa_info->text_segment_base)
+ hppa_info->text_segment_base = value;
+ }
+ else
+ {
+ if (value < hppa_info->data_segment_base)
+ hppa_info->data_segment_base = value;
+ }
+ }
}
/* Called after we have seen all the input files/sections, but before