https://sourceware.org/bugzilla/show_bug.cgi?id=34397

            Bug ID: 34397
           Summary: [RISCV] Fails to function alignment attribute during
                    relax
           Product: binutils
           Version: 2.46
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: bigmagicreadsun at gmail dot com
  Target Milestone: ---

Created attachment 16841
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16841&action=edit
test.c

When linking a RISC-V ELF binary using ld with the --relax option, functions
specified with __attribute__((aligned(0x1000))) are not placed at their
expected 4K-aligned addresses. The alignment request is ignored in the final
linked output, despite being correctly emitted in the object file's relocation
entries.

source files test.c and link.ld

riscv64-unknown-elf-gcc -march=rv32imac -mabi=ilp32 -ffunction-sections
-save-temps -v -O2 -c test.c


riscv64-unknown-elf-ld -m elf32lriscv -T link.ld --relax test.o -o test.elf


riscv64-unknown-elf-nm test.elf | grep protected_execute


Observed: 8000103a T protected_execute (not 0x1000-aligned).


GNU ld (GNU Binutils) 2.46.50.20260608

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to