Skip to content

Conversation

@rountree
Copy link
Collaborator

Fixes #188.

gcc v8+ can, during compilation, mark code as "cold" that cannot be executed during compliant runs (e.g., executes via undefined behavior). Users can also add the "cold" attribute to functions to indicate they are executed rarely, can be optimized for size rather than speed, and may be placed together with other "cold" functions elsewhere in the binary to improve locality of hot functions.

The 4.18 kernel builds an objdump tool that (erroneously?) detects code fallthrough between the write_allowlist() and write_allowlist.cold() functions (and vice versa). Rather than force the use of a more recent objdump, we simple declare the entire function as "cold" for kernels older that v5.

The warnings are not present with gcc 15.2.0 and kernel/objdump 6.14.0.

Fixes llnl#188.

gcc v8+ can, during compilation, mark code as "cold" that cannot be
executed during compliant runs (e.g., executes via undefined
behavior).  Users can also add the "cold" attribute to functions
to indicate they are executed rarely, can be optimized for size
rather than speed, and may be placed together with other "cold"
functions elsewhere in the binary to improve locality of hot
functions.

The 4.18 kernel builds an objdump tool that (erroneously?) detects
code fallthrough between the write_allowlist() and
write_allowlist.cold() functions (and vice versa).  Rather than
force the use of a more recent objdump, we simple declare the
entire function as "cold" for kernels older that v5.

The warnings are not present with gcc 15.2.0 and kernel/objdump
6.14.0.
@rountree rountree requested a review from slabasan as a code owner October 17, 2025 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

objtool warnings

2 participants