https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116887
Bug ID: 116887
Summary: Section type conflict on loongarch with .data.rel.ro
section attribute
Product: gcc
Version: 13.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: fw at gcc dot gnu.org
Target Milestone: ---
The attached reproducer when compiled with -c fPIC fails to build (with some
additional diagnostics added not available upstream):
/tmp/bug.i:6798:1: error: section ‘.data.rel.ro’ type conflict with
‘_dlfo_main’
6798 | }
| ^
/tmp/bug.i:6190:39: note: ‘_dlfo_main’ was declared here
6190 | static struct dl_find_object_internal _dlfo_main __attribute__
((section (".data.rel.ro")));
| ^~~~~~~~~~
/tmp/bug.i:6798:1: error: previous section type: WRITE|NOTYPE|DECLARED|NAMED
6798 | }
| ^
/tmp/bug.i:6798:1: error: new section type: WRITE|NOTYPE|NAMED|RELRO
This problem does not occur on other architectures. This section attribute is
used elsewhere in glibc without problem, and the current glibc upstream code
for elf/dl-find_object.c is quite similar and also builds on loongarch.