aboutsummaryrefslogtreecommitdiff
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
commit7ae8e4e8051c4f9320f95e568ac4b03604999d45 (patch)
treeb8a882e35d1b0e00ade14809e3aad9ddf04a0aac /bfd/elf32-hppa.c
parent7833b9b3df967c4f0b08e86960f25d25e19c2037 (diff)
downloadgdb-7ae8e4e8051c4f9320f95e568ac4b03604999d45.zip
gdb-7ae8e4e8051c4f9320f95e568ac4b03604999d45.tar.gz
gdb-7ae8e4e8051c4f9320f95e568ac4b03604999d45.tar.bz2
* 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 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)