foss-for-synopsys-dwc-arc-processors / linux

Helpful resources for users & developers of Linux kernel for ARC
22 stars 13 forks source link

Add R_ARC_S25H_PCREL relocation inti the kernel #101

Closed pavelvkozlov closed 1 year ago

pavelvkozlov commented 1 year ago

Add the R_ARC_S25H_PCREL relocation to the list of known and add code to resolve this relocation. Replacement of jump instructions (j) to branches (b) in the .fixup section (commit 955b7c7007e9) cause to appearance of the new relocation type R_ARC_S25H_PCREL, which can be added by the compiler to handle relative offsets in kernel modules.

Decision to use branch instructions in the .fixup section is not optimal it limits jumps to +16M/-16M, but currently this should by enough, typical ARC kernel .text segment is about 4-8Mb.

Tested on ARCv2 le(QEMU), ARCv2 be(nSim), ARCv3 HS5x(QEMU), ARCv3HS6x(QEMU).