From d457dcf69843196978118f12d749e8aa284202a0 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 10 Feb 2005 09:15:08 +0000 Subject: [PATCH] * bfd-in.h (BFD_LINKER_CREATED): Define. * bfd-in2.h: Rebuilt. * elflink.c (bfd_elf_size_dynamic_sections): Disregard BFD_LINKER_CREATED bfds when determining input bfds without .note.GNU-stack section. * emultempl/hppaelf.em (hppaelf_create_output_section_statements): Set BFD_LINKER_CREATED on the stubs bfd. * emultempl/ppc64elf.em (ppc_create_output_section_statements): Likewise. --- bfd/ChangeLog | 8 ++++++++ bfd/bfd-in.h | 6 +++++- bfd/bfd-in2.h | 6 +++++- bfd/elflink.c | 2 +- ld/ChangeLog | 7 +++++++ ld/emultempl/hppaelf.em | 1 + ld/emultempl/ppc64elf.em | 1 + 7 files changed, 28 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 889411f523..1cc875fa0e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2005-02-10 Jakub Jelinek + + * bfd-in.h (BFD_LINKER_CREATED): Define. + * bfd-in2.h: Rebuilt. + * elflink.c (bfd_elf_size_dynamic_sections): Disregard + BFD_LINKER_CREATED bfds when determining input bfds without + .note.GNU-stack section. + 2005-02-10 Maciej W. Rozycki * elf64-mips.c (mips16_gprel_reloc): Update a comment. diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 8695e684fa..033db48d82 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -1,7 +1,7 @@ /* Main header file for the bfd library -- portable access to object files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -230,6 +230,10 @@ bfd_format; /* The sections in this BFD specify a memory page. */ #define HAS_LOAD_PAGE 0x1000 + +/* This BFD has been created by the linker and doesn't correspond + to any input file. */ +#define BFD_LINKER_CREATED 0x2000 /* Symbols and relocation. */ diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index da2d8cc2c1..8afe498cbf 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -8,7 +8,7 @@ /* Main header file for the bfd library -- portable access to object files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -245,6 +245,10 @@ bfd_format; /* The sections in this BFD specify a memory page. */ #define HAS_LOAD_PAGE 0x1000 + +/* This BFD has been created by the linker and doesn't correspond + to any input file. */ +#define BFD_LINKER_CREATED 0x2000 /* Symbols and relocation. */ diff --git a/bfd/elflink.c b/bfd/elflink.c index b8b9af5e2e..6c65babafd 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -4895,7 +4895,7 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, { asection *s; - if (inputobj->flags & DYNAMIC) + if (inputobj->flags & (DYNAMIC | BFD_LINKER_CREATED)) continue; s = bfd_get_section_by_name (inputobj, ".note.GNU-stack"); if (s) diff --git a/ld/ChangeLog b/ld/ChangeLog index 82d9b1c80a..3561308cf5 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2005-02-10 Jakub Jelinek + + * emultempl/hppaelf.em (hppaelf_create_output_section_statements): + Set BFD_LINKER_CREATED on the stubs bfd. + * emultempl/ppc64elf.em (ppc_create_output_section_statements): + Likewise. + 2005-02-08 Mark Mitchell * scripttempl/armbpabi.sc (VERSION): Make special section symbols diff --git a/ld/emultempl/hppaelf.em b/ld/emultempl/hppaelf.em index 2b03fbe679..b6b9ce6dd6 100644 --- a/ld/emultempl/hppaelf.em +++ b/ld/emultempl/hppaelf.em @@ -88,6 +88,7 @@ hppaelf_create_output_section_statements (void) return; } + stub_file->the_bfd->flags |= BFD_LINKER_CREATED; ldlang_add_file (stub_file); } diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em index 338e090eb7..de4f02fcd6 100644 --- a/ld/emultempl/ppc64elf.em +++ b/ld/emultempl/ppc64elf.em @@ -92,6 +92,7 @@ ppc_create_output_section_statements (void) return; } + stub_file->the_bfd->flags |= BFD_LINKER_CREATED; ldlang_add_file (stub_file); ppc64_elf_init_stub_bfd (stub_file->the_bfd, &link_info); }