[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7a085947-9011-ebc9-a97d-7a62c755a978@loongson.cn>
Date: Thu, 8 Jun 2023 15:01:19 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Huacai Chen <chenhuacai@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Leo Yan <leo.yan@...aro.org>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, loongarch@...ts.linux.dev,
loongson-kernel@...ts.loongnix.cn
Subject: Re: [PATCH v2] perf symbol: Add LoongArch case in get_plt_sizes()
Hi Arnaldo,
On 05/23/2023 06:26 PM, Huacai Chen wrote:
> Acked-by: Huacai Chen <chenhuacai@...ngson.cn>
>
> On Tue, May 23, 2023 at 5:57 PM Tiezhu Yang <yangtiezhu@...ngson.cn> wrote:
>>
>> We can see the following definitions in bfd/elfnn-loongarch.c:
>>
>> #define PLT_HEADER_INSNS 8
>> #define PLT_HEADER_SIZE (PLT_HEADER_INSNS * 4)
>>
>> #define PLT_ENTRY_INSNS 4
>> #define PLT_ENTRY_SIZE (PLT_ENTRY_INSNS * 4)
>>
>> so plt header size is 32 and plt entry size is 16 on LoongArch,
>> let us add LoongArch case in get_plt_sizes().
>>
>> Link: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elfnn-loongarch.c
>> Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
>> ---
>>
>> v2: Add EM_LOONGARCH definition to avoid build error
>>
>> tools/perf/util/symbol-elf.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
>> index b2ed9cc..b3dbf6c 100644
>> --- a/tools/perf/util/symbol-elf.c
>> +++ b/tools/perf/util/symbol-elf.c
>> @@ -35,6 +35,10 @@
>> #define EM_AARCH64 183 /* ARM 64 bit */
>> #endif
>>
>> +#ifndef EM_LOONGARCH
>> +#define EM_LOONGARCH 258
>> +#endif
>> +
>> #ifndef ELF32_ST_VISIBILITY
>> #define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
>> #endif
>> @@ -411,6 +415,10 @@ static bool get_plt_sizes(struct dso *dso, GElf_Ehdr *ehdr, GElf_Shdr *shdr_plt,
>> *plt_header_size = 32;
>> *plt_entry_size = 16;
>> return true;
>> + case EM_LOONGARCH:
>> + *plt_header_size = 32;
>> + *plt_entry_size = 16;
>> + return true;
>> case EM_SPARC:
>> *plt_header_size = 48;
>> *plt_entry_size = 12;
>> --
>> 2.1.0
Are you OK with this change?
Could you please pick it up in your tree?
Thanks,
Tiezhu
Powered by blists - more mailing lists