Use ELF_SECTION_IN_SEGMENT to map segments
The macro ELF_SECTION_IN_SEGMENT should be used when calculating if a section maps to a segment. gdb/ * elfread.c (elf_symfile_segments): Use ELF_SECTION_IN_SEGMENT.
This commit is contained in:
parent
baf00c2d75
commit
62b74cb8b0
2 changed files with 6 additions and 5 deletions
|
@ -14,6 +14,10 @@
|
|||
(cpname_state::d_unary, cpname_state::d_binary): Now methods.
|
||||
(%union): Move earlier.
|
||||
|
||||
2018-06-04 Alan Hayward <alan.hayward@arm.com>
|
||||
|
||||
* elfread.c (elf_symfile_segments): Use ELF_SECTION_IN_SEGMENT.
|
||||
|
||||
2018-06-04 Alan Hayward <alan.hayward@arm.com>
|
||||
|
||||
* aarch64-tdep.c (aarch64_pseudo_read_value_1): New helper func.
|
||||
|
|
|
@ -120,17 +120,14 @@ elf_symfile_segments (bfd *abfd)
|
|||
for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
|
||||
{
|
||||
int j;
|
||||
CORE_ADDR vma;
|
||||
|
||||
if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
|
||||
continue;
|
||||
|
||||
vma = bfd_get_section_vma (abfd, sect);
|
||||
Elf_Internal_Shdr *this_hdr = &elf_section_data (sect)->this_hdr;
|
||||
|
||||
for (j = 0; j < num_segments; j++)
|
||||
if (segments[j]->p_memsz > 0
|
||||
&& vma >= segments[j]->p_vaddr
|
||||
&& (vma - segments[j]->p_vaddr) < segments[j]->p_memsz)
|
||||
if (ELF_SECTION_IN_SEGMENT (this_hdr, segments[j]))
|
||||
{
|
||||
data->segment_info[i] = j + 1;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue