when using the gnu linker ld, I find the error occures when there is one of the
objs which to be handled by linker and which has a huge elf section(such as the
sec .debug_macinfo when using option -g3) .

code segment locate at file elflink.c
...
  /* Allocate some memory to hold information read in from the input
     files.  */
  if (max_contents_size != 0)
    {
      finfo.contents = bfd_malloc (max_contents_size);
      if (finfo.contents == NULL)
        goto error_return;
    }
...

during my modification of the code , I resolved the problem, and I wish to give
some clue to the ld's maintainer to improve the ld:

I use the disk file to store the max sec's content instead of keep them in
memory, when we want to modification the sec's content I will write the
modification back to the file; when we want to get some info from the section, I
will open the file and fseek, then fread; 

all of the above are realized by tracing the usage of "finfo.contents", I use a
totally equivalence way to assure the correctness.

of course, the ld needs much more time to finish the work: I use the ld after
doing my modification to link some obj file together, and to generate one huge
execuable elf file whose length almost exceed the 2G bytes, and it takes almost
one hour.

if the info above does help to the new version's development, i will post some
code segment.

-- 
           Summary: when the obj file's length exceed the limitation, the
                    linker exit with errors
           Product: binutils
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: shihhuangti at 163 dot com
                CC: bug-binutils at gnu dot org,nickc at redhat dot com
  GCC host triplet: cygwin for powerpc target
GCC target triplet: all target


http://sourceware.org/bugzilla/show_bug.cgi?id=7073

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to