1) The linker was storing permission flags in the bottom byte and the
size in the top 56 bits. Newlib was looking for the permission flags
in the top byte and the length in the bottom 56 bits of a uint64_t
stored as bytes 8:16 of the fragment.
N.b. The ABI requires a given storage order between the size and
permission flags (as opposed to requiring a given uint64_t value be
stored in the relevant position). This means that our current
implementation would not work for a hypothetical big-endian Morello.
2) The linker prioritised SEC_READONLY flags over SEC_CODE ones on the
section, this meant that function symbols into the .text section
(which has both flags on it) would be given read-only permissions
rather than executable permissions.
This patch also must update all tests to account for this change.