[binutils-gdb] gas: deprecate .vtable_entry and .vtable_inherit
Richard Earnshaw via Binutils-cvs <[email protected]> Fri, 12 Jun 2026 09:33:54 +0000 (GMT)
| Newsgroups | gmane.comp.gnu.binutils.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4cdc9a9d93571737476034869dd8caaecb5ca35d commit 4cdc9a9d93571737476034869dd8caaecb5ca35d Author: Richard Earnshaw <[email protected]> Date: Thu Jun 11 14:50:13 2026 +0100 gas: deprecate .vtable_entry and .vtable_inherit These ELF directives were a GNU extension to support the C++ ABI that was in use before the introduction of the generic C++ ABI in GCC-3.0. They're obsolete now and many newer targets simply do not provide the back-end support for them. Flag them as deprecated in the NEWS file, and remove the documentation for them. Warn (once) if the directive is used in a source file. Diff: --- gas/NEWS | 5 +++++ gas/config/obj-elf.c | 16 ++++++++++++++++ gas/doc/as.texi | 8 ++++++++ 3 files changed, 29 insertions(+) diff --git a/gas/NEWS b/gas/NEWS index e384d1135c0..bfb42063575 100644 --- a/gas/NEWS +++ b/gas/NEWS @@ -1,5 +1,10 @@ -*- text -*- +* The legacy .vtable_entry and .vtable_inherit directives that were + needed for versions of GCC prior to gcc-3.0 (when the generic C++ + ABI was adopted) are now considered obsolete. They are now deprecated + and will be removed in a future release. + Changes in 2.46: * Add support for AMD Zen6 processor. diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 09a224147e9..6850cab1902 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -2019,6 +2019,14 @@ obj_elf_get_vtable_inherit (void) void obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED) { + static bool warned = false; + + if (!warned) + { + warned = true; + as_warn(".vtable_inherit has been deprecated"); + } + (void) obj_elf_get_vtable_inherit (); } @@ -2061,6 +2069,14 @@ obj_elf_get_vtable_entry (void) void obj_elf_vtable_entry (int ignore ATTRIBUTE_UNUSED) { + static bool warned = false; + + if (!warned) + { + warned = true; + as_warn("'.vtable_entry' has been deprecated"); + } + (void) obj_elf_get_vtable_entry (); } diff --git a/gas/doc/as.texi b/gas/doc/as.texi index 5c80a3100dc..3c4d20bd7d4 100644 --- a/gas/doc/as.texi +++ b/gas/doc/as.texi @@ -4724,8 +4724,11 @@ Some machine configurations provide additional directives. @ifset ELF * Version:: @code{.version "@var{string}"} +@ignore * VTableEntry:: @code{.vtable_entry @var{table}, @var{offset}} * VTableInherit:: @code{.vtable_inherit @var{child}, @var{parent}} +@end ignore + @end ifset * Warnif:: @code{.warnif @var{expression}} @@ -7796,7 +7799,11 @@ This directive creates a @code{.note} section and places into it an ELF formatted note of type NT_VERSION. The note's name is set to @code{string}. @end ifset +@ignore @ifset ELF +@c .vtable_entry and .vtable_inherit were for the C++ implementation +@c that predated the generic C++ ABI. They're obsolete now, so +@c don't include them in the documentation. @node VTableEntry @section @code{.vtable_entry @var{table}, @var{offset}} @@ -7813,6 +7820,7 @@ This directive finds the symbol @code{child} and finds or creates the symbol parent whose addend is the value of the child symbol. As a special case the parent name of @code{0} is treated as referring to the @code{*ABS*} section. @end ifset +@end ignore @node Warnif @section @code{.warnif "@var{expression}"}