Skip to contentSkip to conversation

objtool error "mlxfw_firmware_flash.cold(): STT_FUNC at end of section"

DISCUSSION Arnd Bergmann 1 participant 1 message Nov 13

lore
Share & tools
lore
#0 lore raw

I keep running into an objtool build failure in the mellanox firmware driver on x86 randconfig builds with gcc-16.2:

drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.o: error: objtool: mlxfw_firmware_flash.cold(): STT_FUNC at end of section

This looks like an empty function that is not referenced from anywhere, which points to a mistake in the compiler rather than objtool or the driver:

.section .text.unlikely
.type mlxfw_firmware_flash.cold, @function
mlxfw_firmware_flash.cold:
.L84:
.text
.size mlxfw_firmware_flash, .-mlxfw_firmware_flash
.section .text.unlikely
.size mlxfw_firmware_flash.cold, .-mlxfw_firmware_flash.cold

The only thing I can tell about the function being unusual is that the successful return path has a pr_info() in it that causes this to be the "cold" section while the error return is not cold. If I add another printk() into the error case, the objtool error turns into a warning in some but not all configurations:

drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.o: warning: objtool: mlxfw_firmware_flash(): unexpected end of section .text.unlikely

In this case, the same function is not empty but still not referenced:

Disassembly of section .text.unlikely:
0000000000000000 <mlxfw_firmware_flash.cold>:

   0:   4c 89 6d e8             mov    %r13,-0x18(%rbp)
   4:   4c 89 75 f0             mov    %r14,-0x10(%rbp)

I've attached the .config and the object file I got for both cases.

Arnd