diff options
author | Alan Modra <amodra@gmail.com> | 2020-04-18 10:15:35 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-04-18 10:24:17 +0930 |
commit | 18f97353547b1a00d5840d2ad6e7e67f44488070 (patch) | |
tree | 2bf0c092afd18a4c4b1e45a033143a0f79481323 /bfd | |
parent | 41937b52d8a71627853d432697b63ec8c586c98c (diff) | |
download | gdb-18f97353547b1a00d5840d2ad6e7e67f44488070.zip gdb-18f97353547b1a00d5840d2ad6e7e67f44488070.tar.gz gdb-18f97353547b1a00d5840d2ad6e7e67f44488070.tar.bz2 |
bfd_is_const_section thinko
* section.c (bfd_is_const_section): Correct test for special
sections.
* bfd-in2.h: Regenerate.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 4 | ||||
-rw-r--r-- | bfd/section.c | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b9ee795..9d5f1cb 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2020-04-18 Alan Modra <amodra@gmail.com> + + * section.c (bfd_is_const_section): Correct test for special + sections. + * bfd-in2.h: Regenerate. + 2020-04-17 Alan Modra <amodra@gmail.com> PR 25842 diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 7aa6455..8693f86 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1329,7 +1329,9 @@ bfd_is_ind_section (const asection *sec) static inline bfd_boolean bfd_is_const_section (const asection *sec) { - return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; + return (sec >= _bfd_std_section + && sec < _bfd_std_section + (sizeof (_bfd_std_section) + / sizeof (_bfd_std_section[0]))); } /* Return TRUE if input section SEC has been discarded. */ diff --git a/bfd/section.c b/bfd/section.c index ecad4cd..17f5b4c 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -688,7 +688,9 @@ CODE_FRAGMENT .static inline bfd_boolean .bfd_is_const_section (const asection *sec) .{ -. return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +. return (sec >= _bfd_std_section +. && sec < _bfd_std_section + (sizeof (_bfd_std_section) +. / sizeof (_bfd_std_section[0]))); .} . .{* Return TRUE if input section SEC has been discarded. *} |