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

--- Comment #3 from Fangrui Song <i at maskray dot me> ---
In LLD, a single address assignment pass is sufficient for -r links. Although
multiple iterations could theoretically be supported if the linker script uses
ADDR, I haven't seen such scripts.
(Additionally, all output section addresses are reset to zero for -r links.)

In my patch, I do this:

When called with an input section (`sec` is not null): If the section
alignment is >= 4, advance `dot` to insert NOPs and synthesize an ALIGN
relocation.

When called after all input sections are processed (`sec` is null): The
output relocation section is updated with all the newly synthesized ALIGN
relocations. When processing the .text output section, the patch inserts
relocations in the first input section within .rela.text that contains RELAX.

I use $alignment-2 for simplicity, regardless of RVC. I think linkers handle
$alignment-2, even without the C extension.

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

Reply via email to