Hi YiFei.

This is OK for both trunk and GCC 10.
Thanks for the fix!

[I see you don't have a copyright transfer contract in place.  I believe
 this change, and also the patch in 2/2, are small/trivial enough to not
 require one, but if you plan to do more contributions in the future we
 will need you to do the paperwork.  I just sent you more information
 about this privately.]

> 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  <zhuyifei1...@gmail.com>
>
> gcc/
>
>       * config/bpf/bpf.h (FUNCTION_BOUNDARY): Set to 64.
> ---
>  gcc/config/bpf/bpf.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/config/bpf/bpf.h b/gcc/config/bpf/bpf.h
> index ef0123b56a63..7ff2f310d583 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

Reply via email to