On 24.10.2012 22:29, Attilio Rao wrote:
On Wed, Oct 24, 2012 at 9:25 PM, Andre Oppermann <an...@freebsd.org> wrote:
On 24.10.2012 21:06, Attilio Rao wrote:
As I've already said in another thread __align() doesn't work on
object declaration, so what that won't pad it either if it is global
or part of a struct.
It is just implemented as __attribute__((aligned(X))):
http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Type-Attributes.html


Actually it seems gcc itself doesn't really care and it up to the
linker to honor that.

Yes but the concept being that if you use __aligned() properly (when
defining a struct) the object will be correctly sized, so you will get
padding automatically.

Yes.  With __aligned() the start of the element/structure should
begin on an address evenly dividable by the align value *and* it
should pad out any remaining space up to the next evenly dividable
address.

The problem we have is that is apparently doesn't work correctly
within gcc when creating structs nor within the linker when placing
such supposedly aligned structs in the .bss section (at least the
padding is missing).

It seems to come down to either a) fixing gcc+ld; or b) hacking
around it by magically padding the structs that require it.

--
Andre

_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to