[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.21.2106290955030.3234@pobox.suse.cz>
Date: Tue, 29 Jun 2021 09:55:16 +0200 (CEST)
From: Miroslav Benes <mbenes@...e.cz>
To: Michael Forney <mforney@...rney.org>
cc: Josh Poimboeuf <jpoimboe@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] objtool: Update section header before relocations
On Sat, 8 May 2021, Michael Forney wrote:
> The libelf implemention from elftoolchain has a safety check in
> gelf_update_rel[a] to check that the data corresponds to a section
> that has type SHT_REL[A] [0]. If the relocation is updated before
> the section header is updated with the proper type, this check
> fails.
>
> To fix this, update the section header first, before the relocations.
> Previously, the section size was calculated in elf_rebuild_reloc_section
> by counting the number of entries in the reloc_list. However, we
> now need the size during elf_write so instead keep a running total
> and add to it for every new relocation.
>
> [0] https://sourceforge.net/p/elftoolchain/mailman/elftoolchain-developers/thread/CAGw6cBtkZro-8wZMD2ULkwJ39J+tHtTtAWXufMjnd3cQ7XG54g@mail.gmail.com/
>
> Signed-off-by: Michael Forney <mforney@...rney.org>
Reviewed-by: Miroslav Benes <mbenes@...e.cz>
M
Powered by blists - more mailing lists