diff options
author | Alan Modra <amodra@gmail.com> | 2018-10-05 22:17:00 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-10-08 20:26:08 +1030 |
commit | 00bee008e9f7d0b3adf3278962450944653787f8 (patch) | |
tree | 880a8f4d14409add15b6d0ea01faaf491caefae2 /ld/testsuite/ld-elf | |
parent | c258c396faa626a4c7929a5ec97ee9b294073c5e (diff) | |
download | gdb-00bee008e9f7d0b3adf3278962450944653787f8.zip gdb-00bee008e9f7d0b3adf3278962450944653787f8.tar.gz gdb-00bee008e9f7d0b3adf3278962450944653787f8.tar.bz2 |
Tidy elf_segment_map allocation
This cleans up elf_segment_map allocation when the section array is
empty. "amt += (to - from - 1) * sizeof (asection *)", when "to" and
"from" are unsigned int results in an unsigned value inside the
parentheses. When "to" and "from" are equal on a 64-bit host,
0xffffffff * 8 is added to "amt", not -8 as desired.
The patch also renames a variable for consistency with other functions
using a similar index.
* elf.c (make_mapping): Cope with zero size array at end of
struct elf_segment_map.
(_bfd_elf_map_sections_to_segments): Likewise.
(rewrite_elf_program_header, copy_elf_program_header): Likewise.
(_bfd_elf_map_sections_to_segments): Rename phdr_index to hdr_index.
Diffstat (limited to 'ld/testsuite/ld-elf')
0 files changed, 0 insertions, 0 deletions