Yep. Shared library removes the relocation problem. There's no real reason why I'm static linking libobjc in, I'm fine to move to a shared lib. Thanks!
> On Jul 17, 2019, at 1:56 PM, David Chisnall <gnus...@theravensnest.org> wrote: > > I think the main hint is to use a dynamic library. Static linking is not > well tested on any platform and the assembly code expects a PIC model. I’m > happy to accept patches that improve the static linking experience, but it’s > not something that I have any plans to work on personally. > > David > >> On 17 Jul 2019, at 20:43, Jordan Schidlowsky <jor...@noodlecake.com> wrote: >> >> I can't seem to get libobjc2 to link in properly to my android app on >> arm64-v8a. I'm using the latest clang prebuilt by Frederik here: >> https://github.com/gnustep/tools-android >> >> I've tried 3 different linkers, and all report the same >> R_AARCH64_ADR_PREL_LO21 issue. bfd was the only linker to provide any >> insight, but it seems like it's related to the SmallObjectClasses symbol. >> Output from each linker is below: >> >> gold: >> libs/libobjc2/objc_msgSend.aarch64.S:97: error: relocation overflow in >> R_AARCH64_ADR_PREL_LO21 >> >> lld: >> ld.lld: error: >> ../../../../libs/libobjc2/objc_msgSend.aarch64.S:97:(.text+0xD0): relocation >> R_AARCH64_ADR_PREL_LO21 out of range: 16077624 is not in [-1048576, 1048575] >> >> bfd: >> libs/libobjc2/libobjc.a(objc_msgSend.S.o): In function `objc_msgSend_stret': >> libs/libobjc2/objc_msgSend.aarch64.S:97:(.text+0xd0): relocation truncated >> to fit: R_AARCH64_ADR_PREL_LO21 against symbol `SmallObjectClasses' defined >> in COMMON section in libs/libobjc2/libobjc.a(class_table.c.o) >> >> >> Any thoughts? >> -Jordan > _______________________________________________ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev