Browse Source
Make _bfd_riscv_relax_call handle section alignment padding same as the _bfd_riscv_relax_lui and _bfd_riscv_relax_pc functions already do. Use the max section alignment if section boundaries are crossed, otherwise the alignment of the containing section. bfd/ PR 25181 * elfnn-riscv.c (_bfd_riscv_relax_call): Always add max_alignment to foff. If sym_sec->output_section and sec->output_section are the same and not *ABS* then set max_alignment to that section's alignment. ld/ PR 25181 * testsuite/ld-riscv-elf/call-relax-0.s: New file. * testsuite/ld-riscv-elf/call-relax-1.s: New file. * testsuite/ld-riscv-elf/call-relax-2.s: New file. * testsuite/ld-riscv-elf/call-relax-3.s: New file. * testsuite/ld-riscv-elf/call-relax.d: New test. * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Run call-relax test. Change-Id: Iaf65cee52345abf1955f36e8e72c4f6cc0db8d9agdb-9-branch
9 changed files with 68 additions and 3 deletions
@ -0,0 +1,9 @@ |
|||||
|
.globl _start |
||||
|
|
||||
|
.section .text.hot |
||||
|
_start: |
||||
|
call cc |
||||
|
|
||||
|
.text |
||||
|
ff: |
||||
|
call dd |
||||
@ -0,0 +1,6 @@ |
|||||
|
.globl align1 |
||||
|
|
||||
|
.text |
||||
|
.balign 32 |
||||
|
align1: |
||||
|
csrr a0, sie |
||||
@ -0,0 +1,7 @@ |
|||||
|
.globl align2 |
||||
|
|
||||
|
.text |
||||
|
.balign 4 |
||||
|
align2: |
||||
|
csrr a0, sie |
||||
|
.fill 0xfffb6 |
||||
@ -0,0 +1,9 @@ |
|||||
|
.globl cc |
||||
|
.globl dd |
||||
|
|
||||
|
.text |
||||
|
cc: |
||||
|
csrr a0, sie |
||||
|
csrr a1, sie |
||||
|
dd: |
||||
|
ret |
||||
@ -0,0 +1,9 @@ |
|||||
|
#name: call relaxation with alignment |
||||
|
#source: call-relax-0.s |
||||
|
#source: call-relax-1.s |
||||
|
#source: call-relax-2.s |
||||
|
#source: call-relax-3.s |
||||
|
#as: -march=rv32ic |
||||
|
#ld: -melf32lriscv |
||||
|
#objdump: -d |
||||
|
#pass |
||||
Loading…
Reference in new issue