public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch] {ELF_MINPAGESIZE,ELF_COMMONPAGESIZE,ELF_MAXPAGESIZE}  coherence
@ 2007-08-18  1:32 Jan Kratochvil
  2007-08-20 13:24 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kratochvil @ 2007-08-18  1:32 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

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

[-- Attachment #2: bfd-pagesizes.patch --]
[-- Type: text/plain, Size: 1030 bytes --]

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

[-- Attachment #3: bfd-ia64-minpagesize.patch --]
[-- Type: text/plain, Size: 530 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] {ELF_MINPAGESIZE,ELF_COMMONPAGESIZE,ELF_MAXPAGESIZE}  coherence
  2007-08-18  1:32 [patch] {ELF_MINPAGESIZE,ELF_COMMONPAGESIZE,ELF_MAXPAGESIZE} coherence Jan Kratochvil
@ 2007-08-20 13:24 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2007-08-20 13:24 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: binutils

On Fri, Aug 17, 2007 at 10:03:13PM +0200, Jan Kratochvil wrote:
> 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.

This one is OK.

-- 
Daniel Jacobowitz
CodeSourcery

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-20 12:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-18  1:32 [patch] {ELF_MINPAGESIZE,ELF_COMMONPAGESIZE,ELF_MAXPAGESIZE} coherence Jan Kratochvil
2007-08-20 13:24 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).