diff options
author | Michael Meissner <gnu@the-meissners.org> | 1997-04-02 21:22:19 +0000 |
---|---|---|
committer | Michael Meissner <gnu@the-meissners.org> | 1997-04-02 21:22:19 +0000 |
commit | acba322ed233a7f4957a9bad369f001729c353cd (patch) | |
tree | 610cc01e53406d5eae405300584e12d3d3ed3ecb | |
parent | 7a68d1f726863aa3b21f3ac288fbb3789f25e26d (diff) | |
download | gdb-acba322ed233a7f4957a9bad369f001729c353cd.zip gdb-acba322ed233a7f4957a9bad369f001729c353cd.tar.gz gdb-acba322ed233a7f4957a9bad369f001729c353cd.tar.bz2 |
Undo part of 3/26 change and always create got section
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 55 |
2 files changed, 45 insertions, 16 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 40541f9..c566510 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +Wed Apr 2 16:19:41 1997 Mike Meissner <meissner@cygnus.com> + + * elf32-ppc.c (ppc_elf_check_relocs): Undo March 26 change and + always create got section so that the _GLOBAL_OFFSET_TABLE_ label + is always created. + Wed Apr 2 10:49:07 1997 Ian Lance Taylor <ian@cygnus.com> * elf-m10200.c: Rename from elf32-mn10200.c. diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index ed58537..ede0608 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -1527,14 +1527,11 @@ ppc_elf_adjust_dynamic_symbol (info, h) s = bfd_get_section_by_name (dynobj, ".dynbss"); BFD_ASSERT (s != NULL); - /* If the symbol is currently defined in the .bss section of the - dynamic object, then it is OK to simply initialize it to zero. - If the symbol is in some other section, we must generate a - R_PPC_COPY reloc to tell the dynamic linker to copy the initial - value out of the dynamic object and into the runtime process - image. We need to remember the offset into the .rela.bss section - we are going to use. */ - if ((h->root.u.def.section->flags & SEC_LOAD) != 0) + /* We must generate a R_PPC_COPY reloc to tell the dynamic linker to + copy the initial value out of the dynamic object and into the + runtime process image. We need to remember the offset into the + .rela.bss section we are going to use. */ + if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) { asection *srel; @@ -1844,14 +1841,9 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) bfd_get_filename (abfd)); #endif - /* Create the linker generated sections all the time so that the special - symbols are created. */ - if ((got = elf_linker_section (abfd, LINKER_SECTION_GOT)) == NULL) - { - got = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_GOT); - if (!got) - ret = false; - } + /* Create the linker generated sections all the time so that the + special symbols are created. The .got section is an exception, + so that we don't waste space allocating it when it is not needed. */ #if 0 if ((plt = elf_linker_section (abfd, LINKER_SECTION_PLT)) == NULL) @@ -1877,6 +1869,13 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) ret = false; } + if ((got = elf_linker_section (abfd, LINKER_SECTION_GOT)) == NULL) + { + got = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_GOT); + if (!got) + ret = false; + } + dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); @@ -1927,6 +1926,18 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) break; } + if (got == NULL + && (got = elf_linker_section (abfd, LINKER_SECTION_GOT)) == NULL) + { + got = ppc_elf_create_linker_section (abfd, info, + LINKER_SECTION_GOT); + if (!got) + { + ret = false; + break; + } + } + if (got->rel_section == NULL && (h != NULL || info->shared) && !_bfd_elf_make_linker_section_rela (dynobj, got, 2)) @@ -1951,6 +1962,18 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) break; } + if (got == NULL + && (got = elf_linker_section (abfd, LINKER_SECTION_GOT)) == NULL) + { + got = ppc_elf_create_linker_section (abfd, info, + LINKER_SECTION_GOT); + if (!got) + { + ret = false; + break; + } + } + if (got->rel_section == NULL && (h != NULL || info->shared) && !_bfd_elf_make_linker_section_rela (dynobj, got, 2)) |