[Bug 291446] /libexec/ld-elf.so.1 not branded properly on riscv, breaks manual activation via ldd
Date: Sun, 07 Dec 2025 05:26:07 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291446
--- Comment #3 from Brandon Bergren <freebsd@bdragon.rtk0.net> ---
What's going wrong for me:
root@sifive:/usr/src/sys # ldd /usr/bin/grep
/usr/bin/grep:
ELF binary type "0" not known.
ldd: /usr/bin/grep: Exec format error
/usr/bin/grep: exit status 1
root@sifive:/usr/src/sys # cp /libexec/ld-elf.so.1 /libexec/ld-elf.so.1.patched
&& \
> brandelf -t FreeBSD /libexec/ld-elf.so.1.patched && \
> cp /libexec/ld-elf.so.1.patched /libexec/ld-elf.so.1.new &&\
> chflags noschg /libexec/ld-elf.so.1 && \
> /libexec/ld-elf.so.1.patched /bin/mv /libexec/ld-elf.so.1 /libexec/ld-elf.so.1.old && \
> /libexec/ld-elf.so.1.patched /bin/mv /libexec/ld-elf.so.1.new /libexec/ld-elf.so.1 && \
> chflags schg /libexec/ld-elf.so.1
root@sifive:/usr/src/sys # ldd /usr/bin/grep
/usr/bin/grep:
libregex.so.1 => /usr/lib/libregex.so.1 (0x64eaba000)
libc.so.7 => /lib/libc.so.7 (0x64ebe9000)
libsys.so.7 => /lib/libsys.so.7 (0x64fb31000)
root@sifive:/usr/src/sys #
ldd works by running the runtime linker as a program rather than an
interpreter, with some extra environment set.
Anyway, I'll stare at the __elfN(get_brandinfo) code and the riscv md bits and
see if I can spot why it isn't happy with things as-is.
--
You are receiving this mail because:
You are the assignee for the bug.