File: armhf-64k-alignment.diff

package info (click to toggle)
binutils 2.45-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 408,956 kB
  • sloc: ansic: 1,465,081; asm: 816,463; cpp: 87,135; exp: 79,234; makefile: 67,950; sh: 20,839; yacc: 14,149; lisp: 13,640; perl: 13,404; lex: 1,714; ada: 1,681; pascal: 1,446; cs: 879; python: 630; java: 478; sed: 191; xml: 95; awk: 25
file content (30 lines) | stat: -rw-r--r-- 1,145 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
The upstream binutils commit below reduced the section alignment of
armhf executables (including shared libraries) from 64k to 4k, on the
basis that the additional bloat is not justified, given that arm64 hosts
running 64k pagesize kernels with armhf user space are not used in
practice.

However, the situation is slightly different today on Debian, where a
16k pagesize kernel is provided that enables compat support, and is
therefore able to execute armhf user space. The only impediment is the
fact that armhf binaries are no longer compatible with this, due to the
change below.

To accommodate this use case, revert the patch. This makes the generated
executables compatible with compat mode on arm64 systems running 16k
kernels.

--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -20356,7 +20356,11 @@ elf32_arm_backend_symbol_processing (bfd
 #define ELF_ARCH			bfd_arch_arm
 #define ELF_TARGET_ID			ARM_ELF_DATA
 #define ELF_MACHINE_CODE		EM_ARM
+#ifdef __QNXTARGET__
 #define ELF_MAXPAGESIZE			0x1000
+#else
+#define ELF_MAXPAGESIZE			0x10000
+#endif
 #define ELF_COMMONPAGESIZE		0x1000
 
 #define bfd_elf32_mkobject			elf32_arm_mkobject