CTSRD-CHERI / lld

http://llvm.org/git/lld with added CHERI support
http://www.chericpu.com
Other
0 stars 3 forks source link

LLD doesn't handle relocation generated by dla #10

Closed arichardson closed 7 years ago

arichardson commented 7 years ago

See https://github.com/CTSRD-CHERI/llvm/issues/188

===> lib/libc (obj,all,install) /home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: numa_setaffinity.S:3: can't create dynamic relocation R_MIPS_HIGHEST against symbol '$tmp6' defined in numa_setaffinity.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: numa_setaffinity.S:3: can't create dynamic relocation R_MIPS_HIGHER against symbol '$tmp6' defined in numa_setaffinity.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: numa_setaffinity.S:3: can't create dynamic relocation R_MIPS_HI16 against symbol '$tmp6' defined in numa_setaffinity.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: numa_setaffinity.S:3: can't create dynamic relocation R_MIPS_HIGHEST against symbol '__cerror' defined in cerror.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: numa_setaffinity.S:3: can't create dynamic relocation R_MIPS_HIGHER against symbol '__cerror' defined in cerror.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: numa_setaffinity.S:3: can't create dynamic relocation R_MIPS_HI16 against symbol '__cerror' defined in cerror.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: numa_getaffinity.S:3: can't create dynamic relocation R_MIPS_HIGHEST against symbol '$tmp6' defined in numa_getaffinity.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: numa_getaffinity.S:3: can't create dynamic relocation R_MIPS_HIGHER against symbol '$tmp6' defined in numa_getaffinity.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: numa_getaffinity.S:3: can't create dynamic relocation R_MIPS_HI16 against symbol '$tmp6' defined in numa_getaffinity.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: numa_getaffinity.S:3: can't create dynamic relocation R_MIPS_HIGHEST against symbol '__cerror' defined in cerror.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: numa_getaffinity.S:3: can't create dynamic relocation R_MIPS_HIGHER against symbol '__cerror' defined in cerror.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: numa_getaffinity.S:3: can't create dynamic relocation R_MIPS_HI16 against symbol '__cerror' defined in cerror.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: procctl.S:3: can't create dynamic relocation R_MIPS_HIGHEST against symbol '$tmp6' defined in procctl.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: procctl.S:3: can't create dynamic relocation R_MIPS_HIGHER against symbol '$tmp6' defined in procctl.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: procctl.S:3: can't create dynamic relocation R_MIPS_HI16 against symbol '$tmp6' defined in procctl.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: procctl.S:3: can't create dynamic relocation R_MIPS_HIGHEST against symbol '__cerror' defined in cerror.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: procctl.S:3: can't create dynamic relocation R_MIPS_HIGHER against symbol '__cerror' defined in cerror.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: procctl.S:3: can't create dynamic relocation R_MIPS_HI16 against symbol '__cerror' defined in cerror.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: aio_mlock.S:3: can't create dynamic relocation R_MIPS_HIGHEST against symbol '$tmp6' defined in aio_mlock.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: aio_mlock.S:3: can't create dynamic relocation R_MIPS_HIGHER against symbol '$tmp6' defined in aio_mlock.pico
/home/alr48/cheri/output/sdk256/bin/cheri-unknown-freebsd-ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation)
--- libc.so.7.full ---
*** [libc.so.7.full] Error code 1

Seems like BFD just ignores R_MIPS_HIGHEST/HIGHER: https://www.cl.cam.ac.uk/~alr48/code/binutils/binutils/bfd/elf64-mips.c.html#541

Might work for local relocations, not sure if this breaks non-local