Hi LLVM developers,
Prepare the implementation of ARC target ELF relocation for lld, so at present it needs ARC GNU toolchain to generate ELF object:
$ cat arc-hello.s main: bl memset bl strncpy bl puts $ /opt/arc-gnu/bin/arc-elf32-gcc -mcpu=arc600 -o arc-hello.o -c arc-hello.s
Relocation:
$ /opt/arc-gnu/bin/arc-elf32-readelf -r arc-hello.o Relocation section '.rela.text' at offset 0x108 contains 3 entries: Offset Info Type Sym.Value Sym. Name + Addend 00000000 00000611 R_ARC_S25W_PCREL 00000000 memset + 0 00000004 00000711 R_ARC_S25W_PCREL 00000000 strncpy + 0 00000008 00000811 R_ARC_S25W_PCREL 00000000 puts + 0
LLD:
$ /opt/llvm-svn/bin/ld.lld -o arc-hello-lld arc-hello.o -L/opt/arc-gnu/lib/gcc/arc-elf32/7.1.1/arc600 -L/opt/arc-gnu/lib/gcc/arc-elf32/7.1.1/../../../../arc-elf32/lib/arc600 -L/opt/arc-gnu/lib/gcc/arc-elf32/7.1.1 -L/opt/arc-gnu/lib/gcc/arc-elf32/7.1.1/../../../../arc-elf32/lib --start-group -lgcc -lc -lnosys --end-group -Ttext=0
Please review it, thanks a lot!
Regards,
Leslie Zhai
If this doesn't add any flags, it shouldn't be here. Otherwise LGTM.