I have a compiled elf file and I would like to verify the optimisation level used. The question is how can I determine optimisation level from an object/elf?
I have tried with “file” command and “objdump” (most of the switches), but none of them revealed this. Is it possible at all?
No, not in general. The compiler doesn’t write its active “optimisation” setting to the object file, and it’s not necessarily possible to determine from the object code itself.