https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112563

--- Comment #3 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot 
Uni-Bielefeld.DE> ---
> --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> Note, following patch
[...]
> passed bootstrap/regtest for me on x86_64-linux and i686-linux and didn't
> create any new memset/memcpy/memmove calls in objdump -dr libasan.so.* (we 
> have
> 2 memset calls
> from inside of libbacktrace, guess we ought to deal with that eventually).
> Does this help on Solaris/sparc?

It's almost there, but not quite: I've started with a Solaris/sparc
build of unpatched libsanitizer which uses gas.  In that case,
libsanitizer.so contains

000fc594 <__asan_backtrace_dwarf_add>:
   fd220:       40 00 9b f2     call  1241e8 <memcpy@plt>
000fd8dc <__asan_backtrace_create_state>:
   fd91c:       40 00 9a 33     call  1241e8 <memcpy@plt>
0010b0b4 <elf_zstd_read_fse>:
  10b384:       40 00 63 e7     call  124320 <memset@plt>
  10b4a0:       40 00 63 a0     call  124320 <memset@plt>

With your patch and using as, there are a few more:

0005ab90 <__asan_register_globals.part.0>:
   5afdc:       40 03 30 d2     call  127324 <memcpy@plt>
00091c94 <printf_common(void*, char const*, void*)>:
   92134:       40 02 54 7c     call  127324 <memcpy@plt>
   926a8:       40 02 53 1f     call  127324 <memcpy@plt>
000c4154 <__asan::ReportDeadlySignal(__sanitizer::SignalContext const&)>:
   c4218:       40 01 8c 43     call  127324 <memcpy@plt>
000c76b0 <__asan::ReportODRViolation(__asan_global const*, unsigned int,
__asan_global const*, unsigned int)>:  
   c77a8:       40 01 7e df     call  127324 <memcpy@plt>
   c77b8:       40 01 7e db     call  127324 <memcpy@plt>
000e2140 <__sanitizer::VSNPrintf(char*, int, char const*, void*)>:
   e2554:       40 01 13 74     call  127324 <memcpy@plt>
   e2610:       40 01 13 45     call  127324 <memcpy@plt>

gcc warns:

/vol/gcc/src/hg/master/local/libsanitizer/sanitizer_common/sanitizer_redefine_builtins.h:31:104:
warning: ‘asm’ declaration ignored due to conflict with previous rename
[-Wpragmas]
   31 | extern void *__builtin_memcpy (void *, const void *, __SIZE_TYPE__)
__asm ("__sanitizer_internal_memcpy");
      |                                                                        
                               ^
/vol/gcc/src/hg/master/local/libsanitizer/sanitizer_common/sanitizer_redefine_builtins.h:32:106:
warning: ‘asm’ declaration ignored due to conflict with previous rename
[-Wpragmas]
   32 | extern void *__builtin_memmove (void *, const void *, __SIZE_TYPE__)
__asm ("__sanitizer_internal_memmove");
      |                                                                        
                                 ^
/vol/gcc/src/hg/master/local/libsanitizer/sanitizer_common/sanitizer_redefine_builtins.h:33:95:
warning: ‘asm’ declaration ignored due to conflict with previous rename
[-Wpragmas]
   33 | extern void *__builtin_memset (void *, int, __SIZE_TYPE__) __asm
("__sanitizer_internal_memset");
      |                                                                        
                      ^

Though I don't see what previous rename that would be: compiling e.g
asan_globals.cpp with -g3 -save-temps shows no rename (that would be
#pragma redefine_extname, I guess) at all.

Reply via email to