From: YiFei Zhu Date: Thu, 22 Apr 2021 10:05:56 +0000 (-0500) Subject: bpf: align function entry point to 64 bits X-Git-Tag: basepoints/gcc-13~8218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a662e103e911af935aa5c601051c135986ce3de;p=thirdparty%2Fgcc.git bpf: align function entry point to 64 bits Libbpf does not treat paddings after functions well. If function symbols does not cover a whole text section, it will emit error similar to: libbpf: sec '.text': failed to find program symbol at offset 56 Each instruction in BPF is a multiple of 8 bytes, so align the functions to 8 bytes, similar to how clang does it. 2021-04-22 YiFei Zhu gcc/ * config/bpf/bpf.h (FUNCTION_BOUNDARY): Set to 64. --- diff --git a/gcc/config/bpf/bpf.h b/gcc/config/bpf/bpf.h index 9e2f5260900e..6a3907fb6181 100644 --- a/gcc/config/bpf/bpf.h +++ b/gcc/config/bpf/bpf.h @@ -57,8 +57,8 @@ 64-bit at any time. */ #define STACK_BOUNDARY 64 -/* Function entry points are aligned to 128 bits. */ -#define FUNCTION_BOUNDARY 128 +/* Function entry points are aligned to 64 bits. */ +#define FUNCTION_BOUNDARY 64 /* Maximum alignment required by data of any type. */ #define BIGGEST_ALIGNMENT 64