summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-12-11 18:10:19 +0000
committerNick Clifton <nickc@redhat.com>2003-12-11 18:10:19 +0000
commit97985cbf26f9ab6a4e76dc7577b61515bbbc60b8 (patch)
tree055f59f94760f93c04c69d76d71a1cb3b774fda5
parent3575abbea47e7510f26e26638420297c0aaa3616 (diff)
downloadgdb-97985cbf26f9ab6a4e76dc7577b61515bbbc60b8.tar.gz
(INCLUDE_SECTION_IN_SEGMENT): Skip PT_GNU_STACK segments.
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elf.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index da15e5b333d..648b6903c2e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2003-12-11 Nick Clifton <nickc@redhat.com>
+
+ * elf.c (INCLUDE_SECTION_IN_SEGMENT): Skip PT_GNU_STACK segments.
+
2003-12-08 Richard Sandiford <rsandifo@redhat.com>
* elfxx-mips.h, elfxx-mips.c, cpu-mips.c: Convert prototypes.
diff --git a/bfd/elf.c b/bfd/elf.c
index b103b95a42b..cd107bda035 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4625,8 +4625,9 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd)
2. It is an allocated segment,
3. There is an output section associated with it,
4. The section has not already been allocated to a previous segment.
- 5. PT_TLS segment includes only SHF_TLS sections.
- 6. SHF_TLS sections are only in PT_TLS or PT_LOAD segments. */
+ 5. PT_GNU_STACK segments do not include any sections.
+ 6. PT_TLS segment includes only SHF_TLS sections.
+ 7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments. */
#define INCLUDE_SECTION_IN_SEGMENT(section, segment, bed) \
((((segment->p_paddr \
? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \
@@ -4634,6 +4635,7 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd)
&& (section->flags & SEC_ALLOC) != 0) \
|| IS_COREFILE_NOTE (segment, section)) \
&& section->output_section != NULL \
+ && segment->p_type != PT_GNU_STACK \
&& (segment->p_type != PT_TLS \
|| (section->flags & SEC_THREAD_LOCAL)) \
&& (segment->p_type == PT_LOAD \