bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ld strange message


From: Alan Modra
Subject: Re: ld strange message
Date: Mon, 24 Feb 2003 15:19:32 +1030
User-agent: Mutt/1.4i

On Sun, Feb 23, 2003 at 01:20:52PM +0100, Mauro Meneghin wrote:
> while I was linking an object file with ld
> I have got a strange message that tells me to report
> the bug, althought I don't know if it's a bug or not,
> (perhaps I'm doing something I should not do only)

The .got section is special and normally doesn't appear in a
relocatable object file, however I don't see any reason why your
zero length .got section should cause an abort.  I'm commiting
the following.

        * elflink.c (_bfd_elf_create_got_section): Check existing .got
        section flags before concluding that we've already been called.
        Don't use register keyword.
        (_bfd_elf_create_dynamic_sections): Don't use register keyword.

Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.29
diff -u -p -r1.29 elflink.c
--- bfd/elflink.c       30 Nov 2002 08:39:39 -0000      1.29
+++ bfd/elflink.c       24 Feb 2003 04:41:40 -0000
@@ -1,5 +1,5 @@
 /* ELF linking support for BFD.
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -31,14 +31,15 @@ _bfd_elf_create_got_section (abfd, info)
      struct bfd_link_info *info;
 {
   flagword flags;
-  register asection *s;
+  asection *s;
   struct elf_link_hash_entry *h;
   struct bfd_link_hash_entry *bh;
   struct elf_backend_data *bed = get_elf_backend_data (abfd);
   int ptralign;
 
   /* This function may be called more than once.  */
-  if (bfd_get_section_by_name (abfd, ".got") != NULL)
+  s = bfd_get_section_by_name (abfd, ".got");
+  if (s != NULL && (s->flags & SEC_LINKER_CREATED) != 0)
     return TRUE;
 
   switch (bed->s->arch_size)
@@ -111,7 +112,7 @@ _bfd_elf_create_dynamic_sections (abfd, 
      struct bfd_link_info *info;
 {
   flagword flags, pltflags;
-  register asection *s;
+  asection *s;
   struct elf_backend_data *bed = get_elf_backend_data (abfd);
   int ptralign;
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre




reply via email to

[Prev in Thread] Current Thread [Next in Thread]