Page MenuHomeFreeBSD

RISC-V runtime-linker (rtld-elf) MD part
ClosedPublic

Authored by br on Dec 22 2015, 11:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 26, 3:27 AM
Unknown Object (File)
Fri, Jan 17, 11:16 PM
Unknown Object (File)
Dec 26 2024, 8:28 PM
Unknown Object (File)
Dec 10 2024, 3:01 PM
Unknown Object (File)
Nov 25 2024, 12:21 AM
Unknown Object (File)
Nov 23 2024, 7:48 PM
Unknown Object (File)
Nov 19 2024, 4:22 PM
Unknown Object (File)
Nov 12 2024, 8:52 PM
Subscribers
None

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

br retitled this revision from to RISC-V runtime-linker (rtld-elf) MD part.
br updated this object.
br edited the test plan for this revision. (Show Details)
br added reviewers: andrew, emaste.
andrew added inline comments.
libexec/rtld-elf/riscv/rtld_machdep.h
49–54 ↗(On Diff #11576)

Can you implement this as #define rtld_dynamic(obj) (&_DYNAMIC)? It's special on arm64 because otherwise the _DYNAMIC symbol needs to be relocated.

libexec/rtld-elf/riscv/rtld_start.S
67 ↗(On Diff #11576)

Why 72?

76 ↗(On Diff #11576)

Why are you saving this?

79–88 ↗(On Diff #11576)

These are wrong, the offset will trample over the a registers above.

floating point operations fixed

libexec/rtld-elf/riscv/rtld_machdep.h
50–55 ↗(On Diff #11598)

We also need this on RISC-V, I don't remember the reason, but it doesn't work with suggested define

libexec/rtld-elf/riscv/rtld_start.S
68 ↗(On Diff #11598)

9 regs to save

77 ↗(On Diff #11598)

We need that probably because jal overwrites it. So it does not work if we remove that.

80–89 ↗(On Diff #11598)

thanks!

libexec/rtld-elf/riscv/rtld_start.S
77 ↗(On Diff #11598)

BTW, I just looked to Linux port, they do also saving ra.

libexec/rtld-elf/riscv/rtld_machdep.h
50–55 ↗(On Diff #11598)

I suspect for similar reasons (I was just making sure it wasn't just because that's how arm64 does it).

libexec/rtld-elf/riscv/rtld_start.S
68 ↗(On Diff #11598)

I normally write it as addi sp, sp, -(8 * 9) to make it obvious we are saving space for 9 8-byte registers.

81 ↗(On Diff #11598)

Why not move this to the above addi? It should just cost the stack space if it's not used.

I have no idea about RISC-V arch, so I did not catched anything unusual in the arch support.

libexec/rtld-elf/riscv/reloc.c
63 ↗(On Diff #11631)

We usually spell this as

__asm __volatile
83 ↗(On Diff #11631)

Space between ) and next part of the expression is not needed.

br edited edge metadata.

fix style

andrew edited edge metadata.
This revision is now accepted and ready to land.Dec 23 2015, 7:39 PM
This revision was automatically updated to reflect the committed changes.