On Thu, Nov 04, 2021 at 10:12:32PM +0100, Frederic Cambus wrote:
> I'm building myself a small tool [1] to display .gnu.warning.* sections
> names in ELF objects along with their content, and will check which
> other projects use those sections. So far, aside from us, FreeBSD,
> NetBSD, and DragonFly all use these sections in their libc, and glibc
> does as well.

In the past, the linker section was the only option to get usage
warnings. It has the major downside that the implementation is somewhat
buggy as GNU ld triggers the warning in a number of cases that do not
include usage and there is no way to flag individual uses as safe.
This disadvantage doesn't exist with the warning attribute. The downside
of the attribute is that it requires very recent clang or modernish GCC
to be supported. If it is supported, it provides a significant better
user experience.

Joerg

Reply via email to