Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153711549
D14018.id38380.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
833 B
Referenced Files
None
Subscribers
None
D14018.id38380.diff
View Options
Index: sys/mips/mips/machdep.c
===================================================================
--- sys/mips/mips/machdep.c
+++ sys/mips/mips/machdep.c
@@ -383,7 +383,16 @@
void
mips_postboot_fixup(void)
{
- static char fake_preload[256];
+ /*
+ * Ensure the buffer is properly aligned to hold module metadata structures.
+ * When building the kernel with gcc+bfd fake_preload was always
+ * sufficiently aligned. However, when building with clang the compiler is
+ * less conservative and will only align it to 4 bytes which is not enough
+ * on a MIPS64 system which will use `sd` to store to this buffer.
+ *
+ * TODO: Once we depend on C11 we can use _Alignas(u_long) instead.
+ */
+ static char fake_preload[256] __aligned(_Alignof(u_long));
caddr_t preload_ptr = (caddr_t)&fake_preload[0];
size_t size = 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 24, 3:24 AM (3 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32057737
Default Alt Text
D14018.id38380.diff (833 B)
Attached To
Mode
D14018: Make mips_postboot_fixup work when building the kernel with clang+lld
Attached
Detach File
Event Timeline
Log In to Comment