linux/tools/objtool
Sam James e2e13630f9 objtool: Fix calloc call for new -Walloc-size
GCC 14 introduces a new -Walloc-size included in -Wextra which errors out
like:
```
check.c: In function ‘cfi_alloc’:
check.c:294:33: error: allocation of insufficient size ‘1’ for type ‘struct cfi_state’ with size ‘320’ [-Werror=alloc-size]
  294 |         struct cfi_state *cfi = calloc(sizeof(struct cfi_state), 1);
      |                                 ^~~~~~
```

The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```

So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 struct of size `sizeof(struct ...)`. GCC then sees we're not
doing anything wrong.

Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20231107205504.1470006-1-sam@gentoo.org
2023-11-17 10:54:50 +01:00
..
arch objtool: Use 'the fallthrough' pseudo-keyword 2023-10-03 21:37:35 +02:00
Documentation objtool: Move noreturn function list to separate file 2023-05-16 06:31:55 -07:00
include/objtool objtool/x86: Fix SRSO mess 2023-08-16 09:39:16 +02:00
.gitignore objtool: Install libsubcmd in build 2023-01-30 16:27:46 -08:00
Build objtool: Install libsubcmd in build 2023-01-30 16:27:46 -08:00
builtin-check.c objtool: Add verbose option for disassembling affected functions 2023-05-16 06:31:51 -07:00
check.c objtool: Fix calloc call for new -Walloc-size 2023-11-17 10:54:50 +01:00
elf.c objtool: Remove max symbol name length limitation 2023-10-05 17:01:28 -07:00
Makefile objtool: Fix HOSTCC flag usage 2023-02-01 09:15:18 -08:00
noreturns.h * Refactor and clean up TDX hypercall/module call infrastructure 2023-11-01 10:28:32 -10:00
objtool.c objtool: Propagate early errors 2023-10-05 17:01:11 -07:00
orc_dump.c x86,objtool: Split UNWIND_HINT_EMPTY in two 2023-03-23 23:18:58 +01:00
orc_gen.c objtool: Add elf_create_section_pair() 2023-06-07 10:03:17 -07:00
special.c objtool: Get rid of reloc->addend 2023-06-07 10:03:23 -07:00
sync-check.sh objtool: Add objtool_types.h 2023-03-23 23:18:56 +01:00
weak.c objtool: Ditch subcommands 2022-04-22 12:32:01 +02:00