lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f1bcff28-dc9c-2878-10c7-6e653516e66d@loongson.cn>
Date: Wed, 27 Nov 2024 14:39:13 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: Huacai Chen <chenhuacai@...nel.org>, Peter Zijlstra
 <peterz@...radead.org>, loongarch@...ts.linux.dev,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 01/10] objtool: Handle various symbol types of rodata

On 11/27/2024 08:52 AM, Josh Poimboeuf wrote:
> On Tue, Nov 26, 2024 at 06:41:29PM +0800, Tiezhu Yang wrote:
>> On 11/26/2024 02:44 PM, Josh Poimboeuf wrote:
>>> On Fri, Nov 22, 2024 at 12:49:56PM +0800, Tiezhu Yang wrote:
>>>> @@ -2094,12 +2095,19 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn,
>>>
>>> 'prev_offset' needs to be updated as well.
>>
>> I am not sure I understand your comment correctly, I can not see
>> what should to do about 'prev_offset'.
>
> Further down the function there is
>
>   prev_offset = reloc_offset(reloc);
>
> which needs to be changed to
>
>   prev_offset = offset;
>
> as part of the patch.

If I understand correctly, reloc_offset(reloc) is different with
reloc->sym->offset + reloc_addend(reloc), tested on x86 and readelf
shows that their values are different, reloc_offset(reloc) is the
first column of .rela.rodata, reloc->sym->offset is the second to
last column of .rela.rodata, reloc_addend(reloc) is the last column
of .rela.rodata.

If do the above change as you suggested, there will be some objtool
warnings on x86. I think it should be:

   prev_offset = reloc_offset(reloc);

rather than:

   prev_offset = offset;

That is to say, no need to change "prev_offset".
Could you please check it again, please let me know if I am wrong.

Thanks,
Tiezhu


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ