From: OpenOCD-Gerrit <ope...@us...> - 2021-05-01 12:37:38
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via f18a801e03e50274676544d10029c05e1f219246 (commit) via 3c73cca1e09c92b13c77b903fb39ef9386e07fd9 (commit) via ae86bd8e18047ab586e9ac4ca2eafd0bb008ae87 (commit) via 565129119f0dc345a6e7d16bb468ff15cb3b828d (commit) from 9206bd243b0b594821ca96b37517b2e3de80dc39 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f18a801e03e50274676544d10029c05e1f219246 Author: Antonio Borneo <bor...@gm...> Date: Sun Apr 25 20:07:35 2021 +0200 helper/jim-nvp: remove unused function Jim_nvpInit() The files jim-nvp.[ch] were originally inside jimtcl, then in 2011 they were dropped by jimtcl and integrated in OpenOCD. The initial purpose was to make them as an independent library, thus the presence of an 'init' function. Being now part of OpenOCD do not require the 'init' function anymore, that is still empty and unused, plus its name is in violation of the coding style. Drop the function Jim_nvpInit(). Change-Id: I429e10444c86a26dbdc22aa071315324dc5edc3e Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/6187 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/helper/jim-nvp.c b/src/helper/jim-nvp.c index d13bdfba4..2caf18bce 100644 --- a/src/helper/jim-nvp.c +++ b/src/helper/jim-nvp.c @@ -333,9 +333,3 @@ const char *Jim_Debug_ArgvString(Jim_Interp *interp, int argc, Jim_Obj *const *a return Jim_String(debug_string_obj); } - -int Jim_nvpInit(Jim_Interp *interp) -{ - /* This is really a helper library, not an extension, but this is the easy way */ - return JIM_OK; -} commit 3c73cca1e09c92b13c77b903fb39ef9386e07fd9 Author: Antonio Borneo <bor...@gm...> Date: Sun Apr 25 15:47:28 2021 +0200 helper/types: remove type '_Bool' Accordingly to OpenOCD coding style, both typedef and Camelcase symbols are forbidden. The type '_Bool' is not used in the code, having 'bool' as preferred choice. Remove the definition of '_Bool' from 'types.h'. Change-Id: I8863f9836ccd9166e0c69fa5d75d6fef79ae7bfb Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/6186 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/helper/types.h b/src/helper/types.h index f3d5e04a3..010529ffc 100644 --- a/src/helper/types.h +++ b/src/helper/types.h @@ -47,16 +47,10 @@ #ifndef __cplusplus #define false 0 -#define true 1 +#define true 1 -typedef int _Bool; -#else -typedef bool _Bool; #endif /* __cplusplus */ #endif /* HAVE__BOOL */ - -#define bool _Bool - #endif /* HAVE_STDBOOL_H */ /// turns a macro argument into a string constant commit ae86bd8e18047ab586e9ac4ca2eafd0bb008ae87 Author: Antonio Borneo <bor...@gm...> Date: Thu Apr 22 12:06:04 2021 +0200 helper/replacements: remove unused typedef's The ELF typedef's 'Elf32_Sword' and 'Elf32_Hashelt' are not used within OpenOCD. Plus, being their name in CamelCase require extra effort to include them in the exceptions for checkpatch. Remove the unused typedef's. Change-Id: I18f039567edd5b24dbb41df5406c154f31022ae7 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/6178 Tested-by: jenkins Reviewed-by: Christian Hoff <chr...@ad...> diff --git a/src/helper/replacements.h b/src/helper/replacements.h index fff2dde0e..a0c59a79e 100644 --- a/src/helper/replacements.h +++ b/src/helper/replacements.h @@ -241,10 +241,8 @@ static inline int socket_select(int max_fd, typedef uint32_t Elf32_Addr; typedef uint16_t Elf32_Half; typedef uint32_t Elf32_Off; -typedef int32_t Elf32_Sword; typedef uint32_t Elf32_Word; typedef uint32_t Elf32_Size; -typedef Elf32_Off Elf32_Hashelt; #define EI_NIDENT 16 commit 565129119f0dc345a6e7d16bb468ff15cb3b828d Author: Christian Hoff <chr...@ad...> Date: Tue Apr 20 19:14:30 2021 +0200 target/image: report error if ELF file contains no loadable sections The existing code asserted in that case, which is not correct. This would allow the user to crash OpenOCD with a bad ELF file, which is not what we want. A proper error should be reported in that case and OpenOCD should not crash. Change-Id: Ied5a6a6fd4ee0fd163f3fe850d304a121ecbe33a Signed-off-by: Christian Hoff <chr...@ad...> Reviewed-on: http://openocd.zylin.com/6172 Reviewed-by: Jonathan McDowell <noo...@ea...> Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/image.c b/src/target/image.c index 9608375a5..8f72329bd 100644 --- a/src/target/image.c +++ b/src/target/image.c @@ -426,7 +426,10 @@ static int image_elf32_read_headers(struct image *image) (field32(elf, elf->segments32[i].p_filesz) != 0)) image->num_sections++; - assert(image->num_sections > 0); + if (image->num_sections == 0) { + LOG_ERROR("invalid ELF file, no loadable segments"); + return ERROR_IMAGE_FORMAT_ERROR; + } /** * some ELF linkers produce binaries with *all* the program header @@ -548,7 +551,10 @@ static int image_elf64_read_headers(struct image *image) (field64(elf, elf->segments64[i].p_filesz) != 0)) image->num_sections++; - assert(image->num_sections > 0); + if (image->num_sections == 0) { + LOG_ERROR("invalid ELF file, no loadable segments"); + return ERROR_IMAGE_FORMAT_ERROR; + } /** * some ELF linkers produce binaries with *all* the program header ----------------------------------------------------------------------- Summary of changes: src/helper/jim-nvp.c | 6 ------ src/helper/replacements.h | 2 -- src/helper/types.h | 8 +------- src/target/image.c | 10 ++++++++-- 4 files changed, 9 insertions(+), 17 deletions(-) hooks/post-receive -- Main OpenOCD repository |