Bug 247724 - ld-elf.so.1: Unsupported relocation type 42 in non-PLT relocations [clang, llvm-devel-11.0.d20200519]
Summary: ld-elf.so.1: Unsupported relocation type 42 in non-PLT relocations [clang, ll...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.1-RELEASE
Hardware: i386 Any
: --- Affects Some People
Assignee: Konstantin Belousov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-02 19:53 UTC by Nick Briggs
Modified: 2020-07-05 02:10 UTC (History)
4 users (show)

See Also:
koobs: mfc-stable12+
koobs: mfc-stable11-


Attachments
C source test case (335 bytes, text/plain)
2020-07-02 19:53 UTC, Nick Briggs
no flags Details
Final binary "ifunc" (10.98 KB, application/octet-stream)
2020-07-03 15:46 UTC, Nick Briggs
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Briggs 2020-07-02 19:53:03 UTC
Created attachment 216152 [details]
C source test case

The attached test case, ifunc.c (a test case from valgrind) compiled with

$ clang-devel --version
clang version 11.0.0 
Target: i386-portbld-freebsd12.1
Thread model: posix
InstalledDir: /usr/local/llvm-devel/bin

(package info: llvm-devel-11.0.d20200519)

$ clang-devel -o ifunc ifunc.c

generates:

$ ./ifunc
ld-elf.so.1: [...]/ifunc: Unsupported relocation type 42 in non-PLT relocations

$ readelf -r ifunc

Relocation section (.rel.dyn):
r_offset r_info   r_type              st_value st_name
00403918 0000002a R_386_IRELATIVE     00000000 

Relocation section (.rel.plt):
r_offset r_info   r_type              st_value st_name
00403908 00000307 R_386_JUMP_SLOT     004017e0 _init_tls
0040390c 00000607 R_386_JUMP_SLOT     004017f0 exit
00403910 00000407 R_386_JUMP_SLOT     00401800 atexit
00403914 00000707 R_386_JUMP_SLOT     00401810 printf

The same code compiled with clang8 (default compiler on 12.1-RELEASE) shows

$ readelf -r ifunc

Relocation section (.rel.plt):
r_offset r_info   r_type              st_value st_name
0040201c 00000307 R_386_JUMP_SLOT     00401380 _init_tls
00402020 00000607 R_386_JUMP_SLOT     00401390 exit
00402024 00000407 R_386_JUMP_SLOT     004013a0 atexit
00402028 00000707 R_386_JUMP_SLOT     004013b0 printf
0040202c 0000002a R_386_IRELATIVE     00000000
Comment 1 Konstantin Belousov freebsd_committer 2020-07-03 06:28:33 UTC
Attach the final binary.
Comment 2 Nick Briggs 2020-07-03 15:46:26 UTC
Created attachment 216174 [details]
Final binary "ifunc"

Attaching executable for test case.
Comment 3 Konstantin Belousov freebsd_committer 2020-07-03 16:02:03 UTC
This case was fixed by HEAD r357895+rr357910 and stable/12 r358142.
Comment 4 Ed Maste freebsd_committer 2020-07-03 16:04:41 UTC
confirmed working on ref12-i386 with
12.1-STABLE FreeBSD 12.1-STABLE #0 r362643
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2020-07-05 02:10:15 UTC
^Triage:

- Correct Resolution (FIXED "by commit")
- Assign to committer that resolved
- Tracke merge(es)