|
From: | Ziyao |
Subject: | Re: [Tinycc-devel] Re : Re: win32: -Wl,-nostdlib: undefined symbol 'memset' |
Date: | Sun, 10 Sep 2023 18:50:48 +0800 |
On 2023-09-10 15:13, Страхиња Радић wrote:
What is weird is that tcc requires a libc function, memset, when none isexplicitly requested, when for example this code:
It is not that weird I think. Early versions of GCC generates a call to memset()
as well when zeroing a block of memory [1]btw, the call could be easily eliminated by add a function like gen_struct_copy() in x86_64-gen.c. And this call may lead to problems. For example, the dynamic linker of musl has code that zeros a structure, but at that time memset() has not
been relocated, result in a segfault. -- Ziyao [1]: check for clear_storage() in gcc/expr.c of commit 3b6f75e2 of gcc
[Prev in Thread] | Current Thread | [Next in Thread] |