This is the mail archive of the
mailing list for the binutils project.
Re: [gold patch] do not allocate common symbols within the discarded output sections
- From: Viktor Kutuzov <vkutuzov at accesssoftek dot com>
- To: Ian Lance Taylor <iant at google dot com>, Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 10 Oct 2011 13:07:03 -0700
- Subject: Re: [gold patch] do not allocate common symbols within the discarded output sections
- References: <firstname.lastname@example.org>
- Reply-to: <vkutuzov at accesssoftek dot com>
On Tue, 2011-09-27 at 15:28 -0700, Viktor Kutuzov wrote:
> Gold gets an internal error on computing of the final values for the
> common symbols which were allocated within the discarded output
> sections. An appropriate output section could be discarded by the linker
> Please find attached patch which prevents allocating of the common
> symbols if its target output section has been discarded by any reason.
> The command line below reproduces the problem. I tested it on CentOS
> 5.x/i386, but it should be reproducible on the different systems also.
> vkutuzov@:/opt/build/binutils/src/gold/testsuite$ ../ld-new \
> -m elf_i386 --eh-frame-hdr --hash-style=gnu \
> -L/usr/lib -L/usr/lib/gcc/i386-redhat-linux/4.1.1 \
> -l:crt1.o -l:crti.o -l:crtbegin.o \
> -nostartfiles -nostdlib -T memory_test.t memory_test.o \
> -o memory_test -lc -l:crtend.o -l:crtn.o
> ../ld-new: internal error in address, at output.h:72
> The memory_test.t script is a linker script from the current gold
> testsuite set.
> Would you review this patch?
> * common.cc (Symbol_table::do_allocate_commons_list): prevent
> allocation of the common symbols within the discarded output