This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Using function clones for Pointer Bounds Checker
- From: Jeff Law <law at redhat dot com>
- To: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <richard dot guenther at gmail dot com>, "Zamyatin, Igor" <igor dot zamyatin at intel dot com>
- Date: Tue, 13 May 2014 13:21:26 -0600
- Subject: Re: [RFC] Using function clones for Pointer Bounds Checker
- Authentication-results: sourceware.org; auth=none
- References: <CAMbmDYaxC0tZim+AysTLrqak=nX6RmEZQr1QDPU+NG6BYfoE-g at mail dot gmail dot com> <53713B09 dot 9080501 at redhat dot com> <CAMbmDYYjBaafnjym9pQ6y5aErN+TWxvKqBH66LbV6QUFOc8w+A at mail dot gmail dot com>
On 05/13/14 02:38, Ilya Enkovich wrote:
OK. So if I read that correctly, it implies that the existence of
bounds information does not change the signature of the callee. This
is obviously important for C++.
propagate constant bounds value and remove checks in called function).
So from a linking standpoint, presumably you have to mangle the instrumented
caller/callee in some manner. Right? Or are you dynamically dispatching
Originally the idea was o have instrumented clone to have the same
assembler name as the original function. Since instrumented code is
fully compatible with not instrumented code, we always emit only one
version. Usage of the same assembler name allows instrumented and not
instrumented calls to look similar in assembler. It worked fine until
I tried it with LTO where assembler name is used as a unique
identifier. With linker resolutions files it became even more harder
to use such approach. To resolve these issues I started to use new
assembler name with postfix, but linked with the original name using
IDENTIFIER_TRANSPARENT_ALIAS. It gives different assembler names for
clones and originals during compilation, but both clone and original
functions have similar name in output assembler.
Sounds like I need to sit down with the branch and see how this works in
the new scheme.