In ELF64, the sh_flags field is 64-bits wide. recordmcount waserroneously treating it as a 32-bit wide field. For little endianobjects this works because the flags of interest (SHF_EXECINSTR)reside in the lower 32 bits of the word, and you get the same resultwith either a 32-bit or 64-bit read. Big endian objects on theother hand do not work at all with this error.

The fix: Correctly treat sh_flags as 64-bits wide in elf64 objects.

The symptom I observed was that my__start_mcount_loc..__stop_mcount_loc was empty even though ftracefunction tracing was enabled.