<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/tools/objtool/elf.c, branch v5.9.8</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.9.8</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.9.8'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2020-06-18T15:55:29Z</updated>
<entry>
<title>Merge branch 'objtool/urgent' into objtool/core</title>
<updated>2020-06-18T15:55:29Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2020-06-18T15:55:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d832c0051f4e9cc7d26ef3bc6e9b662bc6a90f3a'/>
<id>urn:sha1:d832c0051f4e9cc7d26ef3bc6e9b662bc6a90f3a</id>
<content type='text'>
 Conflicts:
	tools/objtool/elf.c
	tools/objtool/elf.h
	tools/objtool/orc_gen.c
	tools/objtool/check.c

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>objtool: Provide elf_write_{insn,reloc}()</title>
<updated>2020-06-18T15:36:33Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2020-06-12T13:43:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fdabdd0b05e0bdf232340d5da86563ed142a99a7'/>
<id>urn:sha1:fdabdd0b05e0bdf232340d5da86563ed142a99a7</id>
<content type='text'>
This provides infrastructure to rewrite instructions; this is
immediately useful for helping out with KCOV-vs-noinstr, but will
also come in handy for a bunch of variable sized jump-label patches
that are still on ice.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>objtool: Clean up elf_write() condition</title>
<updated>2020-06-18T15:36:33Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2020-04-17T21:15:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2b10be23ac0f8e107fd575397361ddbaebc2944b'/>
<id>urn:sha1:2b10be23ac0f8e107fd575397361ddbaebc2944b</id>
<content type='text'>
With there being multiple ways to change the ELF data, let's more
concisely track modification.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>objtool: Add support for relocations without addends</title>
<updated>2020-06-02T20:37:04Z</updated>
<author>
<name>Matt Helsley</name>
<email>mhelsley@vmware.com</email>
</author>
<published>2020-05-29T21:01:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fb414783b65c880606fbc1463e6849f017e60d46'/>
<id>urn:sha1:fb414783b65c880606fbc1463e6849f017e60d46</id>
<content type='text'>
Currently objtool only collects information about relocations with
addends. In recordmcount, which we are about to merge into objtool,
some supported architectures do not use rela relocations.

Signed-off-by: Matt Helsley &lt;mhelsley@vmware.com&gt;
Reviewed-by: Julien Thierry &lt;jthierry@redhat.com&gt;
Reviewed-by: Kamalesh Babulal &lt;kamalesh@linux.vnet.ibm.com&gt;
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
</content>
</entry>
<entry>
<title>objtool: Rename rela to reloc</title>
<updated>2020-06-01T14:40:58Z</updated>
<author>
<name>Matt Helsley</name>
<email>mhelsley@vmware.com</email>
</author>
<published>2020-05-29T21:01:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f1974222634010486c1692e843af0ab11304dd2c'/>
<id>urn:sha1:f1974222634010486c1692e843af0ab11304dd2c</id>
<content type='text'>
Before supporting additional relocation types rename the relevant
types and functions from "rela" to "reloc". This work be done with
the following regex:

  sed -e 's/struct rela/struct reloc/g' \
      -e 's/\([_\*]\)rela\(s\{0,1\}\)/\1reloc\2/g' \
      -e 's/tmprela\(s\{0,1\}\)/tmpreloc\1/g' \
      -e 's/relasec/relocsec/g' \
      -e 's/rela_list/reloc_list/g' \
      -e 's/rela_hash/reloc_hash/g' \
      -e 's/add_rela/add_reloc/g' \
      -e 's/rela-&gt;/reloc-&gt;/g' \
      -e '/rela[,\.]/{ s/\([^\.&gt;]\)rela\([\.,]\)/\1reloc\2/g ; }' \
      -e 's/rela =/reloc =/g' \
      -e 's/relas =/relocs =/g' \
      -e 's/relas\[/relocs[/g' \
      -e 's/relaname =/relocname =/g' \
      -e 's/= rela\;/= reloc\;/g' \
      -e 's/= relas\;/= relocs\;/g' \
      -e 's/= relaname\;/= relocname\;/g' \
      -e 's/, rela)/, reloc)/g' \
      -e 's/\([ @]\)rela\([ "]\)/\1reloc\2/g' \
      -e 's/ rela$/ reloc/g' \
      -e 's/, relaname/, relocname/g' \
      -e 's/sec-&gt;rela/sec-&gt;reloc/g' \
      -e 's/(\(!\{0,1\}\)rela/(\1reloc/g' \
      -i \
      arch.h \
      arch/x86/decode.c  \
      check.c \
      check.h \
      elf.c \
      elf.h \
      orc_gen.c \
      special.c

Notable exceptions which complicate the regex include gelf_*
library calls and standard/expected section names which still use
"rela" because they encode the type of relocation expected. Also, keep
"rela" in the struct because it encodes a specific type of relocation
we currently expect.

It will eventually turn into a member of an anonymous union when a
susequent patch adds implicit addend, or "rel", relocation support.

Signed-off-by: Matt Helsley &lt;mhelsley@vmware.com&gt;
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
</content>
</entry>
<entry>
<title>objtool: Use sh_info to find the base for .rela sections</title>
<updated>2020-05-28T16:06:05Z</updated>
<author>
<name>Sami Tolvanen</name>
<email>samitolvanen@google.com</email>
</author>
<published>2020-04-21T18:25:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1e968bf5caf65eff3f080102879aaa5440c261b6'/>
<id>urn:sha1:1e968bf5caf65eff3f080102879aaa5440c261b6</id>
<content type='text'>
ELF doesn't require .rela section names to match the base section. Use
the section index in sh_info to find the section instead of looking it
up by name.

LLD, for example, generates a .rela section that doesn't match the base
section name when we merge sections in a linker script for a binary
compiled with -ffunction-sections.

Signed-off-by: Sami Tolvanen &lt;samitolvanen@google.com&gt;
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>objtool: Do not assume order of parent/child functions</title>
<updated>2020-05-28T16:06:05Z</updated>
<author>
<name>Kristen Carlson Accardi</name>
<email>kristen@linux.intel.com</email>
</author>
<published>2020-04-15T21:04:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e000acc145928693833f09152244242a678d3cd5'/>
<id>urn:sha1:e000acc145928693833f09152244242a678d3cd5</id>
<content type='text'>
If a .cold function is examined prior to it's parent, the link
to the parent/child function can be overwritten when the parent
is examined. Only update pfunc and cfunc if they were previously
nil to prevent this from happening.

This fixes an issue seen when compiling with -ffunction-sections.

Signed-off-by: Kristen Carlson Accardi &lt;kristen@linux.intel.com&gt;
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
</content>
</entry>
<entry>
<title>objtool: use gelf_getsymshndx to handle &gt;64k sections</title>
<updated>2020-05-15T08:35:13Z</updated>
<author>
<name>Sami Tolvanen</name>
<email>samitolvanen@google.com</email>
</author>
<published>2020-04-21T22:08:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=28fe1d7bf89f8ed5be70b98a33932dbaf99345dd'/>
<id>urn:sha1:28fe1d7bf89f8ed5be70b98a33932dbaf99345dd</id>
<content type='text'>
Currently, objtool fails to load the correct section for symbols when
the index is greater than SHN_LORESERVE. Use gelf_getsymshndx instead
of gelf_getsym to handle &gt;64k sections.

Signed-off-by: Sami Tolvanen &lt;samitolvanen@google.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lkml.kernel.org/r/20200421220843.188260-2-samitolvanen@google.com
</content>
</entry>
<entry>
<title>objtool: Move the IRET hack into the arch decoder</title>
<updated>2020-04-30T18:14:33Z</updated>
<author>
<name>Miroslav Benes</name>
<email>mbenes@suse.cz</email>
</author>
<published>2020-04-24T14:30:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b490f45362002fef57996388e395efc974b013f4'/>
<id>urn:sha1:b490f45362002fef57996388e395efc974b013f4</id>
<content type='text'>
Quoting Julien:

  "And the other suggestion is my other email was that you don't even
  need to add INSN_EXCEPTION_RETURN. You can keep IRET as
  INSN_CONTEXT_SWITCH by default and x86 decoder lookups the symbol
  conaining an iret. If it's a function symbol, it can just set the type
  to INSN_OTHER so that it caries on to the next instruction after
  having handled the stack_op."

Suggested-by: Julien Thierry &lt;jthierry@redhat.com&gt;
Signed-off-by: Miroslav Benes &lt;mbenes@suse.cz&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Reviewed-by: Miroslav Benes &lt;mbenes@suse.cz&gt;
Acked-by: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Link: https://lkml.kernel.org/r/20200428191659.913283807@infradead.org
</content>
</entry>
<entry>
<title>objtool: Rename elf_read() to elf_open_read()</title>
<updated>2020-04-23T06:34:18Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@kernel.org</email>
</author>
<published>2020-04-22T10:32:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bc359ff2f6f3e8a9df38c39017e269bc442357c7'/>
<id>urn:sha1:bc359ff2f6f3e8a9df38c39017e269bc442357c7</id>
<content type='text'>
'struct elf *' handling is an open/close paradigm, make sure the naming
matches that:

   elf_open_read()
   elf_write()
   elf_close()

Acked-by: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Sami Tolvanen &lt;samitolvanen@google.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20200422103205.61900-3-mingo@kernel.org
</content>
</entry>
</feed>
