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

            Bug ID: 123791
           Summary: [16 Regression] Relocations against .rodata in
                    -fPIE/-fPIC code and other bugs on aarch64 since
                    r16-6776
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

-O2 -fPIE or -O2 -fPIC -fvisibility=hidden
char *
foo ()
{
  return (char *) (__UINTPTR_TYPE__) foo + 7483647;
}
regressed on aarch64-linux with
r16-6776-g1438f92c9e721133031b72a3884ed7bc17d0401c
We should never put constants into .rodata section for -fpic/-fpie if it
contains relocations.
default_elf_select_rtx_section does handle relocations right and also comdats,
even for those I think the r16-6776 change looks wrong, don't have a testcase
right now but I think putting rtxes into .rodata section (even with -fno-pic)
is undesirable because it needs to be removed by the linker if the particular
comdat group is not selected.

Reply via email to