From 1032e7175a0822c74180eb3d979cbe3b4e4c226d Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Thu, 24 Dec 2020 06:56:46 +0100 Subject: [PATCH] ELF: include SHT_NOTE sections everywhere ... not just on the BSDs. Sometimes e.g. .note.ABI-tag is allocated and other sections might contain relocations referring to symbols in them. TCC doesn't do any special processing to them, like merging or somesuch, it just pastes them all together in normal link-editing behaviour. (Seen on a recent openSUSE with glibc 2.32, when the crt1.o file contains debug information) --- tccelf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tccelf.c b/tccelf.c index a6c3f4f2..e31eb9f7 100644 --- a/tccelf.c +++ b/tccelf.c @@ -2781,8 +2781,8 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, #endif #if TARGETOS_OpenBSD || TARGETOS_FreeBSD || TARGETOS_NetBSD sh->sh_type != SHT_X86_64_UNWIND && - sh->sh_type != SHT_NOTE && #endif + sh->sh_type != SHT_NOTE && sh->sh_type != SHT_NOBITS && sh->sh_type != SHT_PREINIT_ARRAY && sh->sh_type != SHT_INIT_ARRAY &&