sshd broken on arm?
Mark Tinguely
tinguely at casselton.net
Fri Jan 18 11:15:53 PST 2008
<deleted background on sshd failing>
> Hmmm Just to make sure that I'm on the right page. On FreeBSD ARM one
> is not supposed to be able to access unaligned memory? Ie. an int that
> does not start on an address that is a multiple of 4.
Some ARM implementation can be programmed to do unaligned accesses, but
yes, halfword, word and long word accesses must be properly aligned.
> In a C function if you have something like "char tmp[4]", can you assume
> that the compiler will align it on a 4 byte boundary or can it do it on
> a byte boundary?
No it will not automatically be align correctly to be used as a integer.
> If one cannot access unaligned ints and char arrays are not int aligned,
> then we were just lucky that the code worked at some stage.
The items above this array were probably a multiple of 4 bytes and something
has changed in a structure to make this no longer true. You can find the
offending structure and pad it to make it a multiple of 4 bytes, or cheat
and declare a integer before the char array.
--Mark Tinguely
More information about the freebsd-arm
mailing list