aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-08-16 17:02:24 +0930
committerAlan Modra <amodra@gmail.com>2022-08-16 18:19:34 +0930
commit45d92439aebd0386ef8af76e1796d08cfe457e1d (patch)
tree39589520a9fe3ce0d50794648dc0c7b8acf3a831 /gdb/gdbarch.h
parent390ddd6f6812474f1d0cfd5447bc12b8dcba2071 (diff)
downloadgdb-45d92439aebd0386ef8af76e1796d08cfe457e1d.zip
gdb-45d92439aebd0386ef8af76e1796d08cfe457e1d.tar.gz
gdb-45d92439aebd0386ef8af76e1796d08cfe457e1d.tar.bz2
PR29495, rewrite_elf_program_header looping
This patch, in order of significance: 1) Replaces some macros with inline functions. 2) Those inline functions catch and avoid arithmetic overflows when comparing addresses. 3) When assigning sections to segments (IS_SECTION_IN_INPUT_SEGMENT) use bed->want_p_paddr_set_to_zero to decide whether lma vs p_paddr or vma vs p_vaddr should be tested. When remapping, use the same test, and use is_note rather than the more restrictive IS_COREFILE_NOTE. It's important that the later tests not be more restrictive. If they are it can lead to the situation triggered by the testcases, where a section seemingly didn't fit and thus needed a new mapping. It didn't fit the new mapping either, and this repeated until memory exhausted. PR 29495 * elf.c (SEGMENT_END, SECTION_SIZE, IS_CONTAINED_BY_VMA): Delete. (IS_CONTAINED_BY_LMA, IS_NOTE, IS_COREFILE_NOTE): Delete. (segment_size, segment_end, section_size): New inline function. (is_contained_by, is_note): Likewise. (rewrite_elf_program_header): Use new functions.
Diffstat (limited to 'gdb/gdbarch.h')
0 files changed, 0 insertions, 0 deletions