Summary: | Ld.elf.so.1 /usr/local/lib/libc.so.6 : Unsupported relocation type 160 in non-PLT relocations | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Praveen Khurjek <praveen_khurjekar> | ||||||
Component: | arm | Assignee: | freebsd-arm (Nobody) <freebsd-arm> | ||||||
Status: | New --- | ||||||||
Severity: | Affects Only Me | CC: | Andrew, emaste | ||||||
Priority: | --- | ||||||||
Version: | 12.4-STABLE | ||||||||
Hardware: | arm | ||||||||
OS: | Any | ||||||||
Attachments: |
|
FreeBSD Clang version 13.0.0 Cannot attach binary due to file size restriction. /usr/local/lib/libc.so.6 is not provided by FreeBSD 12.4; I assume it is from a compat package. Can you add details of what provided it? Created attachment 242668 [details]
libc.so.6
have used the libc.so.6 from the Linux Beaglebone Black Rev C board. For Freebsd only 12xcompat library compiles and it does not provide libc.so.6 for the same.
ELF Header:
Magic: 7f 45 4c 46 01 01 01 03 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: GNU
ABI Version: 0
Type: DYN (Shared object file)
Machine: ARM
Version: 0x1
Entry point address: 0x17679
Start of program headers: 52 (bytes into file)
Start of section headers: 949188 (bytes into file)
Flags: 0x5000400, Version5 EABI, VFP
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 10
Size of section headers: 40 (bytes)
Number of section headers: 71
Section header string table index: 70
the libfwlib32.so.1 is also a linux shared lib. Though the ABI is NONE for the armv7 linux shared lib. ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI: NONE ABI Version: 0 Type: DYN (Shared object file) Machine: ARM Version: 0x1 Entry point address: 0xc390 Start of program headers: 52 (bytes into file) Start of section headers: 895124 (bytes into file) Flags: 0x5000002, Version5 EABI, has entry point Size of this header: 52 (bytes) Size of program headers: 32 (bytes) Number of program headers: 7 Size of section headers: 40 (bytes) Number of section headers: 30 Section header string table index: 27 though not running a linux binary , but using a linux shared lib libc.so.6 with GNU ABI, have not taken the below steps. https://docs.freebsd.org/en/books/handbook/linuxemu/ Are you trying to use both Linux and FreeBSD libraries with the same program? If so that is unlikely to work as they may not share a common ABI, e.g. structures may be different, function arguments may not be shared on all functions, and system call numbers are different. I used the same library for Linux and FreeBSD , and the ABI for the library is NONE if you check comment 4. I will have to use linux emulation for linux library on FreeBSD. I don't have the hardware with me right now , will report back in few days. does NONE equate to Intel Binary Compatibility Standard (iBCS). is iBCS supported by FreeBSD ? NONE means it follows the appropriate ABI as defined in https://github.com/ARM-software/abi-aa/. Cross-OS libraries are likely to be difficult to get working as there are too many things outside the ABI document that need to be handled. On 32-bit arm FreeBSD doesn't support ifuncs that the R_ARM_IRELATIVE (=160) relocation is for. It looks like FreeBSD doesn't have 32-bit arm Linux compat on either arm or arm64. |
Created attachment 242623 [details] Libc.so.6 relocations Binary ldd atest.noprelink: ld-linux-armhf.so.3 (0x20129000) libfwlib32.so.1 => /usr/lib/libfwlib32.so.1 (0x20153000) libthr.so.3 => /lib/libthr.so.3 (0x20236000) libc.so.7 => /lib/libc.so.7 (0x2028e000) libstdc++.so.6 => /usr/local/lib/gcc11/libstdc++.so.6 (0x20500000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x20461000) libc.so.6 => /usr/local/lib/libc.so.6 (0x206ad000) libm.so.5 => /lib/libm.so.5 (0x20498000) Attached is relocations of libc.so.6. possibly due to R_ARM_TLS_TPOFF32 errno relocation in libc.so.6