Put minimum alignment on the dpcpu and vnet section so that ld

when adding the __start_ symbol knows the expected section alignment
and can place the __start_ symbol correctly.

These sections will not support symbols with super-cache line alignment
requirements.

For full details, see posting to freebsd-current, 2009-08-10,
Message-ID: <20090810133111.C93661@maildrop.int.zabbadoz.net>.

Debugging and testing patches by:
		Kamigishi Rei (spambox haruhiism.net),
		np, lstewart, jhb, kib, rwatson
Tested by:	Kamigishi Rei, lstewart
Reviewed by:	kib
Approved by:	re
This commit is contained in:
Bjoern A. Zeeb 2009-08-12 10:26:03 +00:00
parent 9d2eb78bcb
commit 1b501e53f3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=196118
2 changed files with 10 additions and 6 deletions

View File

@ -185,12 +185,14 @@ extern struct sx vnet_sxlock;
* Virtual network stack memory allocator, which allows global variables to
* be automatically instantiated for each network stack instance.
*/
__asm__(
#if defined(__arm__)
__asm__(".section " VNET_SETNAME ", \"aw\", %progbits");
".section " VNET_SETNAME ", \"aw\", %progbits\n"
#else
__asm__(".section " VNET_SETNAME ", \"aw\", @progbits");
".section " VNET_SETNAME ", \"aw\", @progbits\n"
#endif
__asm__(".previous");
"\t.p2align " __XSTRING(CACHE_LINE_SHIFT) "\n"
"\t.previous");
#define VNET_NAME(n) vnet_entry_##n
#define VNET_DECLARE(t, n) extern t VNET_NAME(n)

View File

@ -56,12 +56,14 @@ struct thread;
extern uintptr_t *__start_set_pcpu;
extern uintptr_t *__stop_set_pcpu;
__asm__(
#if defined(__arm__)
__asm__(".section set_pcpu, \"aw\", %progbits");
".section set_pcpu, \"aw\", %progbits\n"
#else
__asm__(".section set_pcpu, \"aw\", @progbits");
".section set_pcpu, \"aw\", @progbits\n"
#endif
__asm__(".previous");
"\t.p2align " __XSTRING(CACHE_LINE_SHIFT) "\n"
"\t.previous");
/*
* Array of dynamic pcpu base offsets. Indexed by id.