[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#996659: gcc-11: static-pie cause link failure



Package: gcc-11
Version: 11.2.0-9
Severity: normal

Dear Maintainer,

gcc-11 -static -fPIE -static-pie hello.c  causes the following link failure:

/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/11/crtbeginT.o: warning: relocation against `__deregister_frame_info' in read-only section `.rodata.cst8'
/usr/bin/ld: read-only segment has dynamic relocations
collect2: error: ld returned 1 exit status

On the other hand, clang-13 can handle the same situation better as below:

$ clang-13 -static -fPIE -static-pie hello.c 
$ ./a.out 
hello world!

Best regards, Ryutaroh Matsumoto

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'stable-security'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: arm64 (aarch64)

Kernel: Linux 5.14.12-clang13 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_CRAP
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gcc-11 depends on:
ii  binutils       2.37-7
ii  cpp-11         11.2.0-9
ii  gcc-11-base    11.2.0-9
ii  libc6          2.32-4
ii  libcc1-0       11.2.0-9
ii  libgcc-11-dev  11.2.0-9
ii  libgcc-s1      11.2.0-9
ii  libgmp10       2:6.2.1+dfsg-2
ii  libisl23       0.23-1
ii  libmpc3        1.2.0-1
ii  libmpfr6       4.1.0-3
ii  libstdc++6     11.2.0-9
ii  libzstd1       1.4.8+dfsg-3
ii  zlib1g         1:1.2.11.dfsg-2

Versions of packages gcc-11 recommends:
ii  libc6-dev  2.32-4

Versions of packages gcc-11 suggests:
pn  gcc-11-doc      <none>
pn  gcc-11-locales  <none>

-- no debconf information


Reply to: