Hi Sam. On Tue, 2026-02-17 at 10:37 +0000, Sam James wrote: > Mark Wielaard <[email protected]> writes: > > > clang with -flto produces object files that contain bitcode. This > > breaks various (self) testcases that expect those .o files are ELF > > files. readelf, nm, elfcheck and elfcompress won't work on such files. > > This isn't specific to Clang. GCC does exactly the same thing. You only > get 'real code' in them if you pass -ffat-lto-objects too.
As far as I know GCC does still produces an ELF file. While clang seems to generate something that isn't an ELF object file. The various elf tests don't really care what exactly is inside the ELF object file, just that it is still valid after whatever transformation has occurred on them. But if it isn't an ELF file to begin with there is little to test. Is there a configuration where GCC generates non-ELF .o files? Thanks, Mark
