[PATCH] [bpf] Symbol sizes and types in object file

Yonghong Song via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 19 09:13:12 PDT 2018



On 9/19/18 8:23 AM, Paul Chaignon wrote:
> Clang-compiled object files currently don't include the symbol sizes and
> types.  Some tools however need that information.  For example, ctfconvert
> uses that information to generate FreeBSD's CTF representation from ELF
> files.
> With this patch, symbol sizes and types are included in object files.
> 
> Signed-off-by: Paul Chaignon <paul.chaignon at orange.com>
> Reported-by: Yutaro Hayakawa <yhayakawa3720 at gmail.com>
> ---
>   lib/Target/BPF/MCTargetDesc/BPFMCAsmInfo.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/Target/BPF/MCTargetDesc/BPFMCAsmInfo.h b/lib/Target/BPF/MCTargetDesc/BPFMCAsmInfo.h
> index 171f7f607ff..af3ad531525 100644
> --- a/lib/Target/BPF/MCTargetDesc/BPFMCAsmInfo.h
> +++ b/lib/Target/BPF/MCTargetDesc/BPFMCAsmInfo.h
> @@ -30,8 +30,8 @@ public:
>       WeakRefDirective = "\t.weak\t";
>   
>       UsesELFSectionDirectiveForBSS = true;
> -    HasSingleParameterDotFile = false;
> -    HasDotTypeDotSizeDirective = false;
> +    HasSingleParameterDotFile = true;
> +    HasDotTypeDotSizeDirective = true;
>   
>       SupportsDebugInformation = true;
>       ExceptionsType = ExceptionHandling::DwarfCFI;

Paul,

Commited to llvm trunk.
https://reviews.llvm.org/rL342556

I have tested this locally with llvm-objdump and did observe
meaningful func type/size from symbol table which will be NONTYPE/0
without this patch.

Could you write a small test at test/CodeGen/BPF for this added feature?


More information about the llvm-commits mailing list