lkml.org 
[lkml]   [2021]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/9] objtool: Rework rebuild_reloc logic
On Thu, Mar 18, 2021 at 11:36:40AM -0500, Josh Poimboeuf wrote:
> > I was thinking you could get a section changed without touching
> > relocations, but while that is theoretically possible, it is exceedingly
> > unlikely (and objtool doesn't do that).
>
> Hm? This is a *relocation* section, not a normal one. So by
> definition, it only changes when its relocations change.

The way I read this code:

list_for_each_entry(sec, &elf->sections, list) {
if (sec->changed) {
+ if (sec->reloc &&
+ elf_rebuild_reloc_section(elf, sec->reloc)) {
+ WARN_ELF("elf_rebuild_reloc_section");
+ return -1;
+ }

is that we iterate the regular sections (which could be dirtied because
we changed some data), and if that section has a relocation section, we
rebuild that for good measure (even though it might not have altered
relocations).

Or am I just totally confused ?

\
 
 \ /
  Last update: 2021-03-18 18:05    [W:0.074 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site