aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2005-01-28 17:58:24 +0000
committerDaniel Jacobowitz <drow@false.org>2005-01-28 17:58:24 +0000
commitb134237006c3ca03ab8a97e0334257885f578f5c (patch)
treedaf04cb932437d9f82462aa5d8f2bfc21fa347ab
parent319850b45155323419e8862ee9e1b20d12b3a62d (diff)
downloadgdb-b134237006c3ca03ab8a97e0334257885f578f5c.zip
gdb-b134237006c3ca03ab8a97e0334257885f578f5c.tar.gz
gdb-b134237006c3ca03ab8a97e0334257885f578f5c.tar.bz2
* elf-bfd.h (struct elf_backend_data): Add minpagesize.
* elf32-arm.c (ELF_MINPAGESIZE): Define. * elf32-ppc.c (ELF_MINPAGESIZE): Define. * elfcode.h (elf_object_p): Use minpagesize instead of maxpagesize. * elfxx-target.h (ELF_MINPAGESIZE): Default to ELF_MAXPAGESIZE. (elfNN_bed): Include ELF_MINPAGESIZE.
-rw-r--r--bfd/ChangeLog10
-rw-r--r--bfd/elf-bfd.h5
-rw-r--r--bfd/elf32-arm.c1
-rw-r--r--bfd/elf32-ppc.c1
-rw-r--r--bfd/elfcode.h4
-rw-r--r--bfd/elfxx-target.h7
6 files changed, 25 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 3b9a9b6..955d393 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,13 @@
+2005-01-28 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * elf-bfd.h (struct elf_backend_data): Add minpagesize.
+ * elf32-arm.c (ELF_MINPAGESIZE): Define.
+ * elf32-ppc.c (ELF_MINPAGESIZE): Define.
+ * elfcode.h (elf_object_p): Use minpagesize instead of
+ maxpagesize.
+ * elfxx-target.h (ELF_MINPAGESIZE): Default to ELF_MAXPAGESIZE.
+ (elfNN_bed): Include ELF_MINPAGESIZE.
+
2005-01-28 Julian Brown <julian@codesourcery.com>
* bin-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 9387915..6645c9a 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -551,6 +551,11 @@ struct elf_backend_data
/* The maximum page size for this backend. */
bfd_vma maxpagesize;
+ /* The minimum page size for this backend. An input object will not be
+ considered page aligned unless its sections are correctly aligned for
+ pages at least this large. May be smaller than maxpagesize. */
+ bfd_vma minpagesize;
+
/* The BFD flags applied to sections created for dynamic linking. */
flagword dynamic_sec_flags;
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 14f46f4..69feb32 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -5721,6 +5721,7 @@ const struct elf_size_info elf32_arm_size_info = {
#else
#define ELF_MAXPAGESIZE 0x8000
#endif
+#define ELF_MINPAGESIZE 0x1000
#define bfd_elf32_bfd_copy_private_bfd_data elf32_arm_copy_private_bfd_data
#define bfd_elf32_bfd_merge_private_bfd_data elf32_arm_merge_private_bfd_data
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index cafbae0..6a1c4e5 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -6171,6 +6171,7 @@ static struct bfd_elf_special_section const ppc_elf_special_sections[]=
#else
#define ELF_MAXPAGESIZE 0x10000
#endif
+#define ELF_MINPAGESIZE 0x1000
#define elf_info_to_howto ppc_elf_info_to_howto
#ifdef EM_CYGNUS_POWERPC
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 0e22c33..e1e995a 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -1,6 +1,6 @@
/* ELF executable support for BFD.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -680,7 +680,7 @@ elf_object_p (bfd *abfd)
&& (i_shdrp[shindex].sh_flags & SHF_ALLOC) != 0
&& i_shdrp[shindex].sh_type != SHT_NOBITS
&& (((i_shdrp[shindex].sh_addr - i_shdrp[shindex].sh_offset)
- % ebd->maxpagesize)
+ % ebd->minpagesize)
!= 0))
abfd->flags &= ~D_PAGED;
}
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 81202f8..a9d49c3 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -1,6 +1,6 @@
/* Target definitions for NN-bit ELF
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004 Free Software Foundation, Inc.
+ 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -283,6 +283,10 @@
#define ELF_MAXPAGESIZE 1
#endif
+#ifndef ELF_MINPAGESIZE
+#define ELF_MINPAGESIZE ELF_MAXPAGESIZE
+#endif
+
#ifndef ELF_DYNAMIC_SEC_FLAGS
/* Note that we set the SEC_IN_MEMORY flag for these sections. */
#define ELF_DYNAMIC_SEC_FLAGS \
@@ -519,6 +523,7 @@ static const struct elf_backend_data elfNN_bed =
ELF_ARCH, /* arch */
ELF_MACHINE_CODE, /* elf_machine_code */
ELF_MAXPAGESIZE, /* maxpagesize */
+ ELF_MINPAGESIZE, /* minpagesize */
ELF_DYNAMIC_SEC_FLAGS, /* dynamic_sec_flags */
elf_info_to_howto,
elf_info_to_howto_rel,