diff options
author | Jeff Law <law@redhat.com> | 1999-08-20 23:03:04 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1999-08-20 23:03:04 +0000 |
commit | 89331d7f5483d41f39e9402aba716154da2fc0ab (patch) | |
tree | bdbed29f74eda9c547cc75f08c862a85bf897901 /bfd/elf-hppa.h | |
parent | 47823ab27b5e5b4cc85ca182f93ebd7f110374ea (diff) | |
download | gdb-89331d7f5483d41f39e9402aba716154da2fc0ab.tar.gz |
* elf-hppa.h (elf_hppa_fake_sections): Compute section indices
here instead of using elf_section_data...
Diffstat (limited to 'bfd/elf-hppa.h')
-rw-r--r-- | bfd/elf-hppa.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index 413b371bacd..f3099b8f8c2 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -636,15 +636,27 @@ elf_hppa_fake_sections (abfd, hdr, sec) if (strcmp (name, ".PARISC.unwind") == 0) { + int indx; asection *sec; hdr->sh_type = SHT_LOPROC + 1; /* ?!? How are unwinds supposed to work for symbols in arbitrary sections? Or what if we have multiple .text sections in a single - .o file? HP really messed up on this one. */ - sec = bfd_get_section_by_name (abfd, ".text"); - if (sec != NULL) - hdr->sh_info = elf_section_data (sec)->this_idx; + .o file? HP really messed up on this one. + Ugh. We can not use elf_section_data (sec)->this_idx at this + point because it is not initialized yet. + + 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++) + { + if (sec->name && strcmp (sec->name, ".text") == 0) + { + hdr->sh_info = indx; + break; + } + } + /* I have no idea if this is really necessary or what it means. */ hdr->sh_entsize = 4; } |