summaryrefslogtreecommitdiff
path: root/bfd/elf32-hppa.c
diff options
context:
space:
mode:
authorDave Anglin <dave.anglin@nrc.ca>2007-12-28 23:43:45 +0000
committerDave Anglin <dave.anglin@nrc.ca>2007-12-28 23:43:45 +0000
commit02f9c2fbf3637e1a1bc61569ae58421b3c02986a (patch)
tree224dc717332b4ad6ca1d17e2cb5cde75ccfa6ea5 /bfd/elf32-hppa.c
parent28792262cb71983f4aefdaf7cb738b22bc2cacc2 (diff)
downloadbinutils-redhat-02f9c2fbf3637e1a1bc61569ae58421b3c02986a.tar.gz
* elf-hppa.h (elf_hppa_osec_to_segment): New function.
(elf_hppa_record_segment_addrs): Use elf_hppa_osec_to_segment. Remove ATTRIBUTE_UNUSED from abfd argument. * elf32-hppa.c (hppa_record_segment_addr): Likewise.
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 20a2f8093b..6fbcd646ec 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)