[llvm-commits] [PATCH] asan-rt: getenv() from .preinit_array

Evgeniy Stepanov eugeni.stepanov at gmail.com
Wed Dec 28 04:43:34 PST 2011


On Wed, Dec 28, 2011 at 3:08 AM, Kostya Serebryany <kcc at google.com> wrote:
> I'd prefer something different:
>
> - Don't put this into sysinfo/sysinfo.cc (we don't use it in some settings,
> also we may want to get rid of it eventually).
> - I suggest we implement ReadProcSelfEnviron in asan_rtl.cc and then use it
> to implement asan_getenv() in asan_linux.cc (and in asan_mac.cc, if needed).
> - no need for PLATFORM_WINDOWS section (yet). Such code will need to go to
> asan_windows.cc once we have it.
> - we want to avoid memchr/memcmp/etc (use __internal* variants).
> - don't fallback to libc, just do ASAN_DIE
> - do we need HAVE___ENVIRON section?
>
> --kcc
>
> On Wed, Dec 21, 2011 at 3:57 AM, Evgeniy Stepanov
> <eugeni.stepanov at gmail.com> wrote:
>>
>> Hi,
>>
>> this patch brings in the implementation of GetenvBeforeMain() from
>> google-perftools and uses it in place of getenv(). This is required to
>> call __asan_init from .preinit_array.
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getenv.patch
Type: text/x-patch
Size: 4878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111228/839f6602/attachment.bin>


More information about the llvm-commits mailing list