aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-hppa.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-hppa.c')
-rw-r--r--bfd/elf32-hppa.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 20a2f80..6fbcd64 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -3256,7 +3256,7 @@ elf32_hppa_final_link (bfd *abfd, struct bfd_link_info *info)
/* Record the lowest address for the data and text segments. */
static void
-hppa_record_segment_addr (bfd *abfd ATTRIBUTE_UNUSED,
+hppa_record_segment_addr (bfd *abfd,
asection *section,
void *data)
{
@@ -3266,30 +3266,9 @@ hppa_record_segment_addr (bfd *abfd ATTRIBUTE_UNUSED,
if ((section->flags & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
- bfd_vma value;
- struct elf_segment_map *m;
- Elf_Internal_Phdr *p;
-
- /* Find the segment that contains the output_section for this section. */
- for (m = elf_tdata (abfd)->segment_map,
- p = elf_tdata (abfd)->phdr;
- m != NULL;
- m = m->next, p++)
- {
- int i;
-
- for (i = m->count - 1; i >= 0; i--)
- if (m->sections[i] == section->output_section)
- break;
- if (i >= 0)
- break;
- }
+ unsigned seg = elf_hppa_osec_to_segment (abfd, section->output_section);
+ bfd_vma value = elf_tdata (abfd)->phdr[seg].p_vaddr;
- if (m == NULL)
- return;
-
- value = p->p_vaddr;
-
if ((section->flags & SEC_READONLY) != 0)
{
if (value < htab->text_segment_base)