diff options
author | Alan Modra <amodra@gmail.com> | 2023-02-22 09:04:57 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-02-22 09:18:25 +1030 |
commit | 45b36294d60e3c72c32f8003b82ee852672f1948 (patch) | |
tree | 277ad967aabc5d85a64a534524e11892cde7fa42 /binutils | |
parent | ee590ebd33ad325dcef4e3656919ef5f9e04e52a (diff) | |
download | gdb-45b36294d60e3c72c32f8003b82ee852672f1948.zip gdb-45b36294d60e3c72c32f8003b82ee852672f1948.tar.gz gdb-45b36294d60e3c72c32f8003b82ee852672f1948.tar.bz2 |
Re: objdump read_section_stabs
Commit f9c36cc99518 changed (and renamed) read_section_stabs with one
difference in overall behaviour. Previously read_section_stabs would
return a NULL for an empty section, which was then treated the same as
a missing section. Now an empty section is recognized and dumped.
This leads to NULL stabp and stabs_end in print_section_stabs. Since
stabs_end - STABSIZE is then a pointer to a very large address, the
test "stabp < stabs_end - STABSIZE" succeeds.
* objdump.c (print_section_stabs): Correct STABSIZE comparison.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/objdump.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c index 984c721..40ed688 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -4508,7 +4508,7 @@ print_section_stabs (bfd *abfd, We start the index at -1 because there is a dummy symbol on the front of stabs-in-{coff,elf} sections that supplies sizes. */ - for (i = -1; stabp <= stabs_end - STABSIZE; stabp += STABSIZE, i++) + for (i = -1; (size_t) (stabs_end - stabp) >= STABSIZE; stabp += STABSIZE, i++) { const char *name; unsigned long strx; |