On 10/28/20 5:58 PM, Jim Wilson wrote:
> We have only riscv64 asan support, there is no riscv32 support as yet.  So I
> need to be able to conditionally enable asan support for the riscv target.  I
> implemented this by returning zero from the asan_shadow_offset function.  This
> requires a change to toplev.c and docs in target.def.
>
> The asan support works on a 5.5 kernel, but does not work on a 4.15 kernel.
> The problem is that the asan high memory region is a small wedge below
> 0x4000000000.  The new kernel puts shared libraries at 0x3fffffffff and going
> down which works.  But the old kernel puts shared libraries at 0x2000000000
> and going up which does not work, as it isn't in any recognized memory
> region.  This might be fixable with more asan work, but we don't really need
> support for old kernel versions.
>
> The asan port is curious in that it uses 1<<29 for the shadow offset, but all
> other 64-bit targets use a number larger than 1<<32.  But what we have is
> working OK for now.
>
> I did a make check RUNTESTFLAGS="asan.exp" on Fedora rawhide image running on
> qemu and the results look reasonable.
>
>               === gcc Summary ===
>
> # of expected passes          1905
> # of unexpected failures      11
> # of unsupported tests                224
>
>               === g++ Summary ===
>
> # of expected passes          2002
> # of unexpected failures      6
> # of unresolved testcases     1
> # of unsupported tests                175
>
> OK?
>
> Jim
>
> 2020-10-28  Jim Wilson  <j...@sifive.com>
>
>       gcc/
>       * config/riscv/riscv.c (riscv_asan_shadow_offset): New.
>       (TARGET_ASAN_SHADOW_OFFSET): New.
>       * doc/tm.texi: Regenerated.
>       * target.def (asan_shadow_offset); Mention that it can return zero.
>       * toplev.c (process_options): Check for and handle zero return from
>       targetm.asan_shadow_offset call.

I noticed you hadn't committed this change.  Just to be explicit, this
is OK for the trunk.


Thanks,

jeff


Reply via email to