On Tue, Jun 10, 2025 at 08:39:10AM -0400, Joe Lawrence wrote:
> >> Should we check for other data section prefixes here, like:
> >>
> >>else {
> >>snprintf(sec_name, SEC_NAME_LEN, ".rodata.%s",
> >> sym->name);
> >>if (!st
On 6/9/25 7:21 PM, Josh Poimboeuf wrote:
> On Mon, Jun 09, 2025 at 02:32:19PM -0400, Joe Lawrence wrote:
>> On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
>>> +static int validate_ffunction_fdata_sections(struct elf *elf)
>>> +{
>>> + struct symbol *sym;
>>> + bool found_text =
On Mon, Jun 09, 2025 at 02:32:19PM -0400, Joe Lawrence wrote:
> On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
> > +static int validate_ffunction_fdata_sections(struct elf *elf)
> > +{
> > + struct symbol *sym;
> > + bool found_text = false, found_data = false;
> > +
> > + fo
On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
> +static int validate_ffunction_fdata_sections(struct elf *elf)
> +{
> + struct symbol *sym;
> + bool found_text = false, found_data = false;
> +
> + for_each_sym(elf, sym) {
> + char sec_name[SEC_NAME_LEN];
>
On Mon, May 26, 2025 at 08:57:16PM +0200, Peter Zijlstra wrote:
> > @@ -50,10 +51,12 @@ struct section {
> > bool _changed, text, rodata, noinstr, init, truncate;
> > struct reloc *relocs;
> > unsigned long nr_alloc_relocs;
> > + struct section *twin;
> > };
> >
> > struct symbol
On Mon, May 26, 2025 at 08:50:40PM +0200, Peter Zijlstra wrote:
>
> Let me hand you a fresh bucket of curlies, you must've run out :-)
Thanks for the freebies, imported curlies aren't so cheap these days!
--
Josh
On Mon, May 26, 2025 at 08:47:00PM +0200, Peter Zijlstra wrote:
> On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
> > +#define SEC_NAME_LEN 512
> > #define SYM_NAME_LEN 512
> >
>
> > +static int validate_ffunction_fdata_sections(struct elf *elf)
> > +
On Mon, May 26, 2025 at 08:27:19PM +0200, Peter Zijlstra wrote:
> On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
> > +static void scan_for_insn(struct section *sec, unsigned long offset,
> > + unsigned long *insn_off, unsigned int *insn_len)
> > +{
> > + unsig
On Mon, May 26, 2025 at 08:22:59PM +0200, Peter Zijlstra wrote:
> On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
>
> > Without '-ffunction-sections -fdata-sections', reliable object diffing
> > would be infeasible due to toolchain limitations:
> >
> > - For intra-file+intra-sec
On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
> +#define KLP_RELOC_SEC_PREFIX ".klp.rela."
> +#define KLP_SYM_PREFIX ".klp.sym."
This max symbol length test is getting more and more broken every day
:-)
On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
> diff --git a/tools/objtool/include/objtool/elf.h
> b/tools/objtool/include/objtool/elf.h
> index 4cfd09e66cb5..f62ac8081f27 100644
> --- a/tools/objtool/include/objtool/elf.h
> +++ b/tools/objtool/include/objtool/elf.h
> @@ -17,6 +1
Let me hand you a fresh bucket of curlies, you must've run out :-)
On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
> +static struct symbol *first_file_symbol(struct elf *elf)
> +{
> + struct symbol *sym;
> +
> + for_each_sym(elf, sym)
{
> + if (is_file_sym
On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
> +#define SEC_NAME_LEN 512
> #define SYM_NAME_LEN 512
>
> +static int validate_ffunction_fdata_sections(struct elf *elf)
> +{
> + struct symbol *sym;
> + bool found_text = false, found_data = false;
> +
> +
On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
> diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
> index cdf385e54c69..ae4f83fcbadf 100644
> --- a/tools/objtool/arch/x86/decode.c
> +++ b/tools/objtool/arch/x86/decode.c
> @@ -95,6 +95,46 @@ s64 arch_in
On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
> Without '-ffunction-sections -fdata-sections', reliable object diffing
> would be infeasible due to toolchain limitations:
>
> - For intra-file+intra-section references, the compiler might
> occasionally generated hard-coded
On 5/14/2025 4:45 AM, Josh Poimboeuf wrote:
On Tue, May 13, 2025 at 10:49:59PM +0800, laokz wrote:
On 5/10/2025 4:17 AM, Josh Poimboeuf wrote:
+
+#define sym_for_each_reloc(elf, sym, reloc)\
+ for (reloc = find_reloc_by_dest_range(elf, sym->sec, \
+
On Tue, May 13, 2025 at 10:49:59PM +0800, laokz wrote:
> On 5/10/2025 4:17 AM, Josh Poimboeuf wrote:
> > +
> > +#define sym_for_each_reloc(elf, sym, reloc)
> > \
> > + for (reloc = find_reloc_by_dest_range(elf, sym->sec,\
> > +
On 5/10/2025 4:17 AM, Josh Poimboeuf wrote:
+
+#define sym_for_each_reloc(elf, sym, reloc)\
+ for (reloc = find_reloc_by_dest_range(elf, sym->sec, \
+ sym->offset, sym->len); \
+reloc && reloc_of
Add a new klp diff subcommand which performs a binary diff between two
object files and extracts changed functions into a new object which can
then be linked into a livepatch module.
This builds on concepts from the longstanding out-of-tree kpatch [1]
project which began in 2012 and has been used
19 matches
Mail list logo