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

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
[hjl@gnu-cfl-2 tmp]$ cat x.c
struct dtv_slotinfo_list
{
  struct dtv_slotinfo_list *next;
};

extern struct dtv_slotinfo_list *list;

static int __attribute__ ((section ("__libc_freeres_fn")))
free_slotinfo (struct dtv_slotinfo_list **elemp)
{
  if (!free_slotinfo (&(*elemp)->next))
    return 0;
  return 1;
}

__attribute__ ((used, section ("__libc_freeres_fn")))
static void free_mem (void)
{
  free_slotinfo (&list);
}
[hjl@gnu-cfl-2 tmp]$ /usr/gcc-11.0.0-x32/bin/gcc -S -O2 x.c -fPIC
x.c: In function ‘free_mem’:
x.c:17:13: error: ‘free_mem’ causes a section type conflict with
‘free_slotinfo.isra’
   17 | static void free_mem (void)
      |             ^~~~~~~~
x.c:9:1: note: ‘free_slotinfo.isra’ was declared here
    9 | free_slotinfo (struct dtv_slotinfo_list **elemp)
      | ^~~~~~~~~~~~~
[hjl@gnu-cfl-2 tmp]$

Reply via email to