This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch] {ELF_MINPAGESIZE,ELF_COMMONPAGESIZE,ELF_MAXPAGESIZE} coherence
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: binutils at sourceware dot org
- Date: Fri, 17 Aug 2007 22:03:13 +0200
- Subject: [patch] {ELF_MINPAGESIZE,ELF_COMMONPAGESIZE,ELF_MAXPAGESIZE} coherence
Hi,
found out that on ia64 there is:
struct elf_backend_data:
{arch = bfd_arch_ia64, ...,
maxpagesize = 65536,
minpagesize = 65536,
commonpagesize = 16384,
...}
violating: minpagesize <= commonpagesize <= maxpagesize
The first patch (bfd-pagesizes.patch) fixes it in a general cross-arch way.
Alternatively there is a simple second patch (bfd-ia64-minpagesize.patch)
fixing up just the IA-64 case.
(The second patch should not be applied if the first one gets approved.)
It is a pre-requisite for a patch for bfd_elf_bfd_from_remote_memory():
http://sourceware.org/ml/binutils/2007-08/msg00225.html
Regards,
Jan
2007-08-17 Jan Kratochvil <jan.kratochvil@redhat.com>
* elfxx-target.h [ELF_COMMONPAGESIZE && ELF_MAXPAGESIZE]
(ELF_MINPAGESIZE): Fixed its size guess. Sanity checked its size.
(ELF_COMMONPAGESIZE, ELF_MAXPAGESIZE): Sanity checked their size.
--- bfd/elfxx-target.h 3 Jul 2007 14:26:42 -0000 1.108
+++ bfd/elfxx-target.h 17 Aug 2007 19:22:55 -0000
@@ -298,16 +298,23 @@
#endif
#ifndef ELF_MAXPAGESIZE
- #error ELF_MAXPAGESIZE is not defined
+# error ELF_MAXPAGESIZE is not defined
#define ELF_MAXPAGESIZE 1
#endif
+#ifndef ELF_COMMONPAGESIZE
+#define ELF_COMMONPAGESIZE ELF_MAXPAGESIZE
+#endif
+
#ifndef ELF_MINPAGESIZE
-#define ELF_MINPAGESIZE ELF_MAXPAGESIZE
+#define ELF_MINPAGESIZE ELF_COMMONPAGESIZE
#endif
-#ifndef ELF_COMMONPAGESIZE
-#define ELF_COMMONPAGESIZE ELF_MAXPAGESIZE
+#if ELF_COMMONPAGESIZE > ELF_MAXPAGESIZE
+# error ELF_COMMONPAGESIZE > ELF_MAXPAGESIZE
+#endif
+#if ELF_MINPAGESIZE > ELF_COMMONPAGESIZE
+# error ELF_MINPAGESIZE > ELF_COMMONPAGESIZE
#endif
#ifndef ELF_DYNAMIC_SEC_FLAGS
2007-08-17 Jan Kratochvil <jan.kratochvil@redhat.com>
* elfxx-ia64.c (ELF_MINPAGESIZE): New definition.
--- bfd/elfxx-ia64.c 3 Jul 2007 14:26:42 -0000 1.200
+++ bfd/elfxx-ia64.c 17 Aug 2007 19:22:55 -0000
@@ -5821,6 +5821,7 @@ elfNN_hpux_backend_symbol_processing (bf
#define ELF_MACHINE_ALT2 1998 /* EAS2.2 */
#define ELF_MAXPAGESIZE 0x10000 /* 64KB */
#define ELF_COMMONPAGESIZE 0x4000 /* 16KB */
+#define ELF_MINPAGESIZE 0x4000 /* 16KB */
#define elf_backend_section_from_shdr \
elfNN_ia64_section_from_shdr