This requires a rather recent clang (https://reviews.llvm.org/D95730),
so I'm not sure if we can commit this as-is now.
Details
previously building a binary with -static and -Wl,--gc-sections on
would not have the FreeBSD ABI note, and on some architectures (e.g. aarch64)
this would result in the kernel ELF loader rejecting the file with:
ELF binary type "0" not known.
This patch is based on CheriBSD (first patch submitted from my Morello board), but I will update to drop the non-upstream parts if this is considered the correct approach to work around this problem.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 46043 Build 42932: arc lint + arc unit
Event Timeline
This was considered but not done as it requires the linker to support SHF_RETAIN. The best option is to move the note to just crti and have a dummy crti for CHERI downstream rather than omit it
Makes sense, it is I was concerned about. How about downstream though, we don't have the old linker constraint there.
I think binutils allows (or allowed) SHF_GNU_RETAIN only with ELFOSABI_GNU or ELFOSABI_FREEBSD, and if we have that then this change is less important.
At the server side (listening side), I am thinking if we move the secure ACK check here and above the TOF_TS check, it would save cycles on checking these timestamps.