[PATCH] D29719: [MC] Accept and print a numeric value as an ELF section header's type

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 15:07:30 PST 2017


Simon Atanasyan <simon at atanasyan.com> writes:

> There is no reason prevent introducing a @mips_dwarf except one --
> it's a long story while the bug needs to be fixed soon. In fact gas
> and other GNU tools do not require a @mips_dwarf at all because they
> use a workaround for .debug_* sections. These tools convert @progbits
> to SHT_MIPS_DWARF flag and vice versa for .debug_* sections when
> parsing / printing assembly.

So what will gas do when it gets an hex value that is SHT_MIPS_DWARF?

> I can implement a new a @mips_dwarf in the separate patch D29789 where
> I set a correct SHT_MIPS_DWARF for .debug_*. But I still think that
> printing a hex value for unknown/unexpected section type in the
> `MCSectionELF::PrintSwitchToSection` routine is a good feature because
> now we emit just "@" in that case and get an asm file that cannot be
> parsed by llvm-mc.

I am pretty sure that printing it for an unknown section is not a good
thing. I would be OK with a white list (with just SHT_MIPS_DWARF for
now) of section types we know are missing a symbolic name but can be
handled with an hex value. If the type is not on the white list we
should just error.

Cheers,
Rafael


More information about the llvm-commits mailing list