
To represent the first and third expression of .align, R_LARCH_ALIGN need to associate with a symbol. We define a local symbol for R_LARCH_AGLIN. But if the section of the local symbol is discarded, it may result in a undefined symbol error. Instead, we use the section name symbols, and this does not need to add extra symbols. During partial linking (ld -r), if the symbol associated with a relocation is STT_SECTION type, the addend of relocation needs to add the section output offset. We prevent it for R_LARCH_ALIGN. The elf_backend_data.rela_normal only can set all relocations of a target to rela_normal. Add a new function is_rela_normal to elf_backend_data, it can set part of relocations to rela_normal.
17 lines
276 B
ArmAsm
17 lines
276 B
ArmAsm
# Use the section name symbol for R_LARCH_ALIGN to avoid discard section problem
|
|
.section ".another.text", "ax"
|
|
.cfi_startproc
|
|
break 0
|
|
.cfi_def_cfa_offset 16
|
|
.p2align 5
|
|
break 1
|
|
.cfi_endproc
|
|
|
|
.text
|
|
.cfi_startproc
|
|
break 0
|
|
.cfi_def_cfa_offset 16
|
|
.p2align 5
|
|
break 1
|
|
.cfi_endproc
|
|
|