From: Jens Gustedt <jens.gustedt@inria.fr>
To: musl@lists.openwall.com
Subject: Re: Solving the recursive memcpy/memset/etc. issue
Date: Thu, 01 Aug 2013 10:26:55 +0200 [thread overview]
Message-ID: <1375345615.27318.228.camel@eris.loria.fr> (raw)
In-Reply-To: <51FA1651.1070801@gentoo.org>
[-- Attachment #1: Type: text/plain, Size: 1339 bytes --]
Am Donnerstag, den 01.08.2013, 10:03 +0200 schrieb Luca Barbato:
> > Well, it would be an ugly heuristic like running cc -S -o - on
> > src/string/memcpy.c, with -Dmemcpy=noname or something, and grepping
> > the output for memcpy...
>
> Indeed.
there might be the word memcpy in comments or whatever, depends on the
assembler format etc. might be really relatively difficult to set up
reliably.
Other options:
- compile it with that -Dmemcpy=noname trick to a normal .o and use
nm to look for an undefined symbol "memcpy".
- use a different name for the implementation of the function from
the start, __musl_memcpy or so. Then you could do the check for the
memcpy symbol on the normally compiled .o and (if everything is ok)
rename the __musl_memcpy to memcpy with some linker trick.
- put "#define memcpy __musl_memcpy" at the start of string.h
if __musl_memcpy would refer to memcpy this would give an link time
error for an undefined symbol.
Jens
--
:: INRIA Nancy Grand Est :: http://www.loria.fr/~gustedt/ ::
:: AlGorille ::::::::::::::: office Nancy : +33 383593090 ::
:: ICube :::::::::::::: office Strasbourg : +33 368854536 ::
:: ::::::::::::::::::::::::::: gsm France : +33 651400183 ::
:: :::::::::::::::::::: gsm international : +49 15737185122 ::
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2013-08-01 8:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-01 0:49 Rich Felker
2013-08-01 6:05 ` Luca Barbato
2013-08-01 6:20 ` Rich Felker
2013-08-01 8:03 ` Luca Barbato
2013-08-01 8:26 ` Jens Gustedt [this message]
2013-08-01 17:48 ` Rich Felker
2013-08-02 2:52 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375345615.27318.228.camel@eris.loria.fr \
--to=jens.gustedt@inria.fr \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).