aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2025-07-16 16:55:51 +0100
committerNick Alcock <nick.alcock@oracle.com>2025-08-10 17:50:39 +0100
commit5e346e5983154b5b824b3a7937c6952deb12c4a3 (patch)
treef0a96d51cecbb069cf1d37e46518902eea86783a
parent2d50e4512900f2508fe12b47b3619cf227c9e013 (diff)
downloadbinutils-5e346e5983154b5b824b3a7937c6952deb12c4a3.zip
binutils-5e346e5983154b5b824b3a7937c6952deb12c4a3.tar.gz
binutils-5e346e5983154b5b824b3a7937c6952deb12c4a3.tar.bz2
libctf: exclude always-emitted Solaris symbols from the symtypetab
If we're skipping _BEGIN_ and _END_ we should certainly skip all the other ABI-required always-emitted symbols given in ld/emultempl/solaris2*em as well. (This fixes a couple of diagnostics tests, but that's just because the tests are quite sensitive to CTF section sizes, and introducing any symtypetab entries for those tests perturbs those.) Some of these are usually STT_NOTYPE, but not always: if programs already emitted the symbol they might end up with any type, in particular STT_OBJECT, and appear in the symtypetabs. [nca: added commit log, added more symbols] libctf/ PR libctf/33162 * ctf-serialize.c (ctf_symtab_skippable): Skip more always-emitted Solaris symbols. (cherry picked from commit 4214ca9036c8f5d01025d0505ff1167700af5f98)
-rw-r--r--libctf/ctf-serialize.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libctf/ctf-serialize.c b/libctf/ctf-serialize.c
index 8c35a2b..f04c278 100644
--- a/libctf/ctf-serialize.c
+++ b/libctf/ctf-serialize.c
@@ -74,6 +74,12 @@ ctf_symtab_skippable (ctf_link_sym_t *sym)
|| sym->st_shndx == SHN_UNDEF
|| strcmp (sym->st_name, "_START_") == 0
|| strcmp (sym->st_name, "_END_") == 0
+ || strcmp (sym->st_name, "_DYNAMIC") == 0
+ || strcmp (sym->st_name, "_GLOBAL_OFFSET_TABLE_") == 0
+ || strcmp (sym->st_name, "_PROCEDURE_LINKAGE_TABLE_") == 0
+ || strcmp (sym->st_name, "_edata") == 0
+ || strcmp (sym->st_name, "_end") == 0
+ || strcmp (sym->st_name, "_etext") == 0
|| (sym->st_type == STT_OBJECT && sym->st_shndx == SHN_EXTABS
&& sym->st_value == 0));
}