Bug created for tracking - reproduction tarball will be added. While linking the FreeBSD/arm kernel modules the linking fails with errors of the form: ld -m armelf_fbsd -Bshareable -d -warn-common -o accf_data.ko.full accf_data.kld ld: error: can't create dynamic relocation R_ARM_ABS32 against local symbol in readonly segment >>> defined in accf_data.kld >>> referenced by accf_data.kld:(__set_modmetadata_set_sym__mod_metadata_md_accf_data_on_kernel) ld: error: can't create dynamic relocation R_ARM_ABS32 against local symbol in readonly segment >>> defined in accf_data.kld >>> referenced by accf_data.kld:(__set_modmetadata_set_sym__mod_metadata_md_accf_data) ld: error: can't create dynamic relocation R_ARM_ABS32 against local symbol in readonly segment >>> defined in accf_data.kld >>> referenced by accf_data.kld:(__set_sysinit_set_sym_accf_datamodule_sys_init)*** [accf_data.ko.full] Error code 1
ping on the reproduction tarball :-)
I noticed something similar in another build. Taking a look.
Created attachment 18651 [details] reproducer .tar
(In reply to Rafael Ávila de Espíndola from comment #2) > I noticed something similar in another build. Taking a look. At least in the case I hit it was just "-z text" being the default. Can you try passing "-z notext"?
(In reply to Rafael Ávila de Espíndola from comment #4) > > At least in the case I hit it was just "-z text" being the default. Can you > try passing "-z notext"? Indeed, I am able to link the arm kernel modules with -z notext, and for kernel modules applying .text relocations is not unreasonable.
(In reply to emaste from comment #5) > (In reply to Rafael Ávila de Espíndola from comment #4) > > > > At least in the case I hit it was just "-z text" being the default. Can you > > try passing "-z notext"? > > Indeed, I am able to link the arm kernel modules with -z notext, and for > kernel modules applying .text relocations is not unreasonable. Yes, a -z text .so is probably the most convenient format for a loadable module that is never shared.
For reference, addressed in FreeBSD here: https://svnweb.freebsd.org/changeset/base/320179
I've now run basic sanity tests with an LLD-linked FreeBSD kernel and modules on BeagleBone black and everything seems fine. root@beaglebone:~ # readelf --string-dump=.comment `sysctl -n kern.bootfile` | grep -i link [ 8a] Linker: LLD 5.0.0 (FreeBSD 305145)