diff options
author | Mark Wielaard <mark@klomp.org> | 2020-10-19 10:17:59 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2020-10-26 22:44:07 +0100 |
commit | 5621fe5443da23112170235dd5cac161e5c75e65 (patch) | |
tree | 84f8a677b49968f253413aca0a5be2cc1b3b13c1 /libdw/ChangeLog | |
parent | e14a5561f7ccb7cec598767d6660a21e8049a818 (diff) | |
download | elfutils-5621fe5443da23112170235dd5cac161e5c75e65.tar.gz |
libdw: dwarf_frame_register takes an array of at least 3 Dwarf_Ops
GCC11 will warn about a mismatch in the declaration of dwarf_frame_register:
dwarf_frame_register.c:37:61: error: argument 3 of type ‘Dwarf_Op *’
declared as a pointer [-Werror=array-parameter=]
37 | dwarf_frame_register (Dwarf_Frame *fs, int regno, Dwarf_Op *ops_mem,
| ~~~~~~~~~~^~~~~~~
libdw.h:1068:43: note: previously declared as an array ‘Dwarf_Op[3]’
1068 | Dwarf_Op ops_mem[3],
| ~~~~~~~~~^~~~~~~~~~
When fixing that it will show an actual bug in the addrcfi testcase:
addrcfi.c:98:16: error: ‘dwarf_frame_register’ accessing 96 bytes in a
region of size 64 [-Werror=stringop-overflow=]
98 | int result = dwarf_frame_register (stuff->frame, regno, ops_mem, &ops, &nops);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
addrcfi.c:98:16: note: referencing argument 3 of type ‘Dwarf_Op *’
1069 | extern int dwarf_frame_register (Dwarf_Frame *frame, int regno,
| ^~~~~~~~~~~~~~~~~~~~
Fix the declaration, fix the bug and add an extra comment to the description
in libdw.h.
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libdw/ChangeLog')
-rw-r--r-- | libdw/ChangeLog | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 1ac4e8a9..731c7e79 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,10 @@ +2020-10-19 Mark Wielaard <mark@klomp.org> + + * dwarf_frame_register.c (dwarf_frame_register): Declare ops_mem + as array of (at least) 3 elements. + * libdw.h (dwarf_frame_register): Add extra explanation of ops_mem + argument. + 2020-10-23 Tom Tromey <tom@tromey.com> * memory-access.h (read_3ubyte_unaligned_inc): Call |