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

            Bug ID: 81923
           Summary: [ASAN] gcc emites wrong odr asan instrumentation for
                    glibc
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: d.khalikov at partner dot samsung.com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

Hello,
I'm currently working on enabling the build of glibc with ASan instrumentation
and facing this type of error:

/tmp/ccKWa1tS.s: Assembler messages:
/tmp/ccKWa1tS.s:20: Error: junk at end of line, first unrecognized character is
`*'
/tmp/ccKWa1tS.s:21: Error: junk at end of line, first unrecognized character is
`*'
/tmp/ccKWa1tS.s:23: Error: unrecognized symbol type ""
/tmp/ccKWa1tS.s:23: Error: junk at end of line, first unrecognized character is
`*'
/tmp/ccKWa1tS.s:24: Error: expected comma after name `__odr_asan.' in .size
directive
/tmp/ccKWa1tS.s:25: Error: invalid character '*' in mnemonic
/tmp/ccKWa1tS.s:53: Error: invalid operands (*UND* and .rodata sections) for
`*'

As far as I understood, the KASAN disables this type of instrumentation:

2567 static bool
2568 asan_needs_odr_indicator_p (tree decl)
2569 {
2570   /* Don't emit ODR indicators for kernel because:
2571      a) Kernel is written in C thus doesn't need ODR indicators.
2572      b) Some kernel code may have assumptions about symbols containing
specific
2573         patterns in their names.  Since ODR indicators contain original
names
2574         of symbols they are emitted for, these assumptions would be broken
for
2575         ODR indicator symbols.  */
2576   return (!(flag_sanitize & SANITIZE_KERNEL_ADDRESS)
2577           && !DECL_ARTIFICIAL (decl)
2578           && !DECL_WEAK (decl)
2579           && TREE_PUBLIC (decl));
2580 }

Could it be some solution for glibc ? Or may be "compile time" flag.
Thanks.

Reply via email to