<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/objtool/elf.c, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-03-19T15:15:07+00:00</updated>
<entry>
<title>objtool: Fix data alignment in elf_add_data()</title>
<updated>2026-03-19T15:15:07+00:00</updated>
<author>
<name>Josh Poimboeuf</name>
<email>jpoimboe@kernel.org</email>
</author>
<published>2026-03-05T03:31:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fa31c5b01bb47f155a5e9ecbe8dc9672032b60c8'/>
<id>urn:sha1:fa31c5b01bb47f155a5e9ecbe8dc9672032b60c8</id>
<content type='text'>
[ Upstream commit 356e4b2f5b80f757965f3f4d0219c81fca91b6f2 ]

Any data added to a section needs to be aligned in accordance with the
section's sh_addralign value.  Particularly strings added to a .str1.8
section.  Otherwise you may get some funky strings.

Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffing object files")
Link: https://patch.msgid.link/d962fc0ca24fa0825cca8dad71932dccdd9312a9.1772681234.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>objtool: Replace custom macros in elf.c with shared ones</title>
<updated>2026-01-27T16:20:41+00:00</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2026-01-26T15:13:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d107b3265aa5e61a1e326b2815a767526ddb12ac'/>
<id>urn:sha1:d107b3265aa5e61a1e326b2815a767526ddb12ac</id>
<content type='text'>
The source file tools/objtool/elf.c defines the macros ALIGN_UP(),
ALIGN_UP_POW2() and MAX(). These macros unnecessarily duplicate
functionality already available under tools/include/, specifically ALIGN(),
roundup_pow_of_two() and max().

More importantly, the definition of ALIGN_UP_POW2() is incorrect when the
input is 1, as it results in a call to __builtin_clz(0), which produces an
undefined result. This issue impacts the function elf_alloc_reloc(). When
adding the first relocation to a section, the function allocates an
undefined number of relocations.

Replace the custom macros with the shared functionality to resolve these
issues.

Fixes: 2c05ca026218 ("objtool: Add elf_create_reloc() and elf_init_reloc()")
Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
Link: https://patch.msgid.link/20260126151356.3924887-1-petr.pavlu@suse.com
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
<entry>
<title>objtool: Remove second pass of .cold function correlation</title>
<updated>2025-11-21T09:04:08+00:00</updated>
<author>
<name>Josh Poimboeuf</name>
<email>jpoimboe@kernel.org</email>
</author>
<published>2025-11-20T20:52:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=106f11d43be53156187270d00c83ddf5ef3f6ac6'/>
<id>urn:sha1:106f11d43be53156187270d00c83ddf5ef3f6ac6</id>
<content type='text'>
The .cold function parent/child correlation logic has two passes: one in
read_symbols() and one in add_jump_destinations().

The second pass was added with commit cd77849a69cf ("objtool: Fix GCC 8
cold subfunction detection for aliased functions") to ensure that if the
parent symbol had aliases then the canonical symbol was chosen as the
parent.

That solution was rather clunky, not to mention incomplete due to the
existence of alternatives and switch tables.  Now that we have
sym-&gt;alias, the canonical alias fix can be done much simpler in the
first pass, making the second pass obsolete.

Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://patch.msgid.link/bdab245a38000a5407f663a031f39e14c67a43d4.1763671318.git.jpoimboe@kernel.org
</content>
</entry>
<entry>
<title>objtool: Return canonical symbol when aliases exist in symbol finding helpers</title>
<updated>2025-11-21T09:04:08+00:00</updated>
<author>
<name>Josh Poimboeuf</name>
<email>jpoimboe@kernel.org</email>
</author>
<published>2025-11-20T20:52:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9205a322cf96f16a49e412dfa3f09431f3e02fc5'/>
<id>urn:sha1:9205a322cf96f16a49e412dfa3f09431f3e02fc5</id>
<content type='text'>
When symbol alias ambiguity exists in the symbol finding helper
functions, return the canonical sym-&gt;alias, as that's the one which gets
used by validate_branch() and elsewhere.

This doesn't fix any known issues, just makes the symbol alias behavior
more robust.

Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://patch.msgid.link/450470a4897706af77453ad333e18af5ebab653c.1763671318.git.jpoimboe@kernel.org
</content>
</entry>
<entry>
<title>objtool: Don't alias undefined symbols</title>
<updated>2025-11-21T09:04:08+00:00</updated>
<author>
<name>Josh Poimboeuf</name>
<email>jpoimboe@kernel.org</email>
</author>
<published>2025-11-20T20:52:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=16f366c5a68839736d3616b466f1738811408ec7'/>
<id>urn:sha1:16f366c5a68839736d3616b466f1738811408ec7</id>
<content type='text'>
Objtool is mistakenly aliasing all undefined symbols.  That's obviously
wrong, though it has no consequence since objtool happens to only use
sym-&gt;alias for defined symbols.  Fix it regardless.

Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://patch.msgid.link/bc401173a7717757eee672fc1ca5a20451d77b86.1763671318.git.jpoimboe@kernel.org
</content>
</entry>
<entry>
<title>objtool: Fix .cold function detection for duplicate symbols</title>
<updated>2025-11-21T09:04:07+00:00</updated>
<author>
<name>Josh Poimboeuf</name>
<email>jpoimboe@kernel.org</email>
</author>
<published>2025-11-20T20:52:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2c2acca2eabf53a954ed5aacef987bbf909b9f12'/>
<id>urn:sha1:2c2acca2eabf53a954ed5aacef987bbf909b9f12</id>
<content type='text'>
The objtool .cold child/parent correlation is done in two phases: first
in elf_add_symbol() and later in add_jump_destinations().

The first phase is rather crude and can pick the wrong parent if there
are duplicates with the same name.

The second phase usually fixes that, but only if the parent has a direct
jump to the child.  It does *not* work if the only branch from the
parent to the child is an alternative or jump table entry.

Make the first phase more robust by looking for the parent in the same
STT_FILE as the child.

Fixes the following objtool warnings in an AutoFDO build with a large
CLANG_AUTOFDO_PROFILE profile:

  vmlinux.o: warning: objtool: rdev_add_key() falls through to next function rdev_add_key.cold()
  vmlinux.o: warning: objtool: rdev_set_default_key() falls through to next function rdev_set_default_key.cold()

Fixes: 13810435b9a7 ("objtool: Support GCC 8's cold subfunctions")
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://patch.msgid.link/82c7b52e40efa75dd10e1c550cc75c1ce10ac2c9.1763671318.git.jpoimboe@kernel.org
</content>
</entry>
<entry>
<title>objtool: Support Clang AUTOFDO .cold functions</title>
<updated>2025-11-21T09:04:07+00:00</updated>
<author>
<name>Josh Poimboeuf</name>
<email>jpoimboe@kernel.org</email>
</author>
<published>2025-11-20T20:52:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=024020e2b6adb4e568fb80f624b5e20d8943f107'/>
<id>urn:sha1:024020e2b6adb4e568fb80f624b5e20d8943f107</id>
<content type='text'>
AutoFDO enables -fsplit-machine-functions which can move the cold parts
of a function to a &lt;func&gt;.cold symbol in a .text.split.&lt;func&gt; section.

Unlike GCC, the Clang &lt;func&gt;.cold symbols are not marked STT_FUNC.  This
confuses objtool in several ways, resulting in warnings like the
following:

  vmlinux.o: warning: objtool: apply_retpolines.cold+0xfc: unsupported instruction in callable function
  vmlinux.o: warning: objtool: machine_check_poll.cold+0x2e: unsupported instruction in callable function
  vmlinux.o: warning: objtool: free_deferred_objects.cold+0x1f: relocation to !ENDBR: free_deferred_objects.cold+0x26
  vmlinux.o: warning: objtool: rpm_idle.cold+0xe0: relocation to !ENDBR: rpm_idle.cold+0xe7
  vmlinux.o: warning: objtool: tcp_rcv_state_process.cold+0x1c: relocation to !ENDBR: tcp_rcv_state_process.cold+0x23

Fix it by marking the .cold symbols as STT_FUNC.

Fixes: 2fd65f7afd5a ("AutoFDO: Enable machine function split optimization for AutoFDO")
Closes: https://lore.kernel.org/20251103215244.2080638-2-xur@google.com
Reported-by: Rong Xu &lt;xur@google.com&gt;
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Reviewed-by: xur@google.com
Tested-by: xur@google.com
Link: https://patch.msgid.link/20a67326f04b2a361c031b56d58e8a803b3c5893.1763671318.git.jpoimboe@kernel.org
</content>
</entry>
<entry>
<title>objtool: Remove unneeded semicolon</title>
<updated>2025-10-30T15:29:46+00:00</updated>
<author>
<name>Chen Ni</name>
<email>nichen@iscas.ac.cn</email>
</author>
<published>2025-10-20T02:09:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5eccd322390e20ca2385f4a4b34ab60e7258ad48'/>
<id>urn:sha1:5eccd322390e20ca2385f4a4b34ab60e7258ad48</id>
<content type='text'>
Remove unnecessary semicolons reported by Coccinelle/coccicheck and the
semantic patch at scripts/coccinelle/misc/semicolon.cocci.

Signed-off-by: Chen Ni &lt;nichen@iscas.ac.cn&gt;
Link: https://patch.msgid.link/20251020020916.1070369-1-nichen@iscas.ac.cn
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
<entry>
<title>objtool: Add base objtool support for livepatch modules</title>
<updated>2025-10-14T21:50:18+00:00</updated>
<author>
<name>Josh Poimboeuf</name>
<email>jpoimboe@kernel.org</email>
</author>
<published>2025-09-17T16:04:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=164c9201e1dad8d5c0c38f583dba81e4b6da9cc7'/>
<id>urn:sha1:164c9201e1dad8d5c0c38f583dba81e4b6da9cc7</id>
<content type='text'>
In preparation for klp-build, enable "classic" objtool to work on
livepatch modules:

  - Avoid duplicate symbol/section warnings for prefix symbols and the
    .static_call_sites and __mcount_loc sections which may have already
    been extracted by klp diff.

  - Add __klp_funcs to the IBT function pointer section whitelist.

  - Prevent KLP symbols from getting incorrectly classified as cold
    subfunctions.

Acked-by: Petr Mladek &lt;pmladek@suse.com&gt;
Tested-by: Joe Lawrence &lt;joe.lawrence@redhat.com&gt;
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
<entry>
<title>objtool: Refactor prefix symbol creation code</title>
<updated>2025-10-14T21:50:18+00:00</updated>
<author>
<name>Josh Poimboeuf</name>
<email>jpoimboe@kernel.org</email>
</author>
<published>2025-09-17T16:04:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2058f6d1660edc4a9bda9bee627792b352121b10'/>
<id>urn:sha1:2058f6d1660edc4a9bda9bee627792b352121b10</id>
<content type='text'>
The prefix symbol creation code currently ignores all errors, presumably
because some functions don't have the leading NOPs.

Shuffle the code around a bit, improve the error handling and document
why some errors are ignored.

Acked-by: Petr Mladek &lt;pmladek@suse.com&gt;
Tested-by: Joe Lawrence &lt;joe.lawrence@redhat.com&gt;
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
</feed>
