![]() |
|
Message-ID: <2oo481p4-8pq5-146r-1ss7-n79266663n85@nqncgvir-ragrecevfrf.pbz> Date: Tue, 15 Apr 2025 14:55:38 +1000 (AEST) From: David Leonard <d+musl@...ptive-enterprises.com> To: Rich Felker <dalias@...c.org> cc: musl@...ts.openwall.com Subject: Re: [PATCH] arm: add support for R_ARM_REL32 relocations On Mon, 14 Apr 2025, Rich Felker wrote: > On Tue, Apr 15, 2025 at 09:50:37AM +1000, David Leonard wrote: >> This fixes an issue found after building libpcap.so with -Os: >> >> Error relocating /lib/libpcap.so.1: unsupported relocation type 3 >> >> $ readelf -Dr lib/libpcap.so.1.10.4 | grep R_ARM_REL32 >> 00019058 0000be03 R_ARM_REL32 00037044 eproto_db >> --- a/arch/arm/reloc.h >> +++ b/arch/arm/reloc.h >> @@ -17,6 +17,7 @@ >> #define TPOFF_K 0 >> >> #define REL_SYMBOLIC R_ARM_ABS32 >> +#define REL_OFFSET32 R_ARM_REL32 >> #define REL_GOT R_ARM_GLOB_DAT >> #define REL_PLT R_ARM_JUMP_SLOT >> #define REL_RELATIVE R_ARM_RELATIVE > Are you sure this is correct, and can you figure out how a relocation > of this type was emitted by the linker? Usually this kind of error > comes from non-PIC-compatible code getting linked into a shared > library, and adding a mapping for the reloc type may just paper over > an error that's going to make something crash later on. ucfront-gcc arm-linux-musleabi-20240415-gcc -fvisibility=hidden -Os -ffunction-sections -fdata-sections -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-z,noexecstack -fPIE -pipe -fno-common -fno-builtin -Wall -Dlinux -D__linux__ -Dunix -DCONFIG_ACCELECON -DOPTIMIZE_FOR_SIZE -DEMBED -fpic -I. -DBUILDING_PCAP -Dpcap_EXPORTS -DHAVE_CONFIG_H -Os -ffunction-sections -fdata-sections -fstack-protector-strong -Wl,-z,relro,-z,now -Wl,-z,noexecstack -fPIE -pipe -fno-common -fno-builtin -Wall -Dlinux -D__linux__ -Dunix -DCONFIG_ACCELECON -DOPTIMIZE_FOR_SIZE -DEMBED -c ./nametoaddr.c Yes, I don't think that -fPIE should be there.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.