Bug 12549 - --as-needed should ignore weak references
Summary: --as-needed should ignore weak references
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.23
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-07 13:02 UTC by Pierre Ossman
Modified: 2015-05-08 04:41 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
binutils-2.20-weak-as-needed.patch (713 bytes, patch)
2011-03-07 13:02 UTC, Pierre Ossman
Details | Diff
binutils-2.21-as-needed-cleanup.patch (537 bytes, patch)
2013-01-09 15:34 UTC, Pierre Ossman
Details | Diff
test case (430 bytes, application/x-bzip2)
2013-01-10 12:23 UTC, Pierre Ossman
Details
A different patch for the strtab problem (1.29 KB, patch)
2013-01-10 13:53 UTC, Alan Modra
Details | Diff
An example (496 bytes, application/octet-stream)
2013-01-14 17:04 UTC, H.J. Lu
Details
as-needed patch for binutils 2.23.2 (395 bytes, patch)
2013-09-15 14:19 UTC, Rose Garcia
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Ossman 2011-03-07 13:02:25 UTC
Created attachment 5276 [details]
binutils-2.20-weak-as-needed.patch

This is a bug entry for the following thread:

http://sourceware.org/ml/binutils/2010-04/msg00246.html

The basic problem is that on Solaris you easily get programs depending on libgcc_s even though they do no really need any symbols from it. We considered this a bug and fixed binutils to behave the way it does on Linux (glibc) systems.

Initial message with the details:

I'm struggling with a bit of a problem when using the GNU toolchain
for a solaris target. This seems to be a fairly well known issue as
it's the basis for the USE_LD_AS_NEEDED thing in gcc. Unfortunately the
problem still isn't fully solved, so I was hoping to get some input and
hopefully progress this further.

The basic problem is:

 - On non-glibc systems, crtbegin.o (from gcc) references
   __register_frame_info. It does this always, even though it's only
   really needed for exception handling. To alleviate this, the
   references are marked as weak and the code is written to handle
   these not getting resolved by the linker.

 - When linking together a DSO, gcc will always add -lgcc_s and ld will
   (correctly) add this as a dependency and will satisfy the
   __register_frame_info references. Let's call this DSO libfoo.

 - Linking a program does _not_ make gcc append -lgcc_s, so normally
   you wouldn't get that unnecessary dependency. But linking a program
   that uses libfoo makes ld follow the DT_NEEDED of it and put up
   libgcc_s on the list of DSOs to check. Since the program will also
   have crtbegin.o, with the weak __register_frame_info reference in
   it, ld will add libgcc_s to the program as DT_NEEDED.

End result is that you have programs depending on libgcc_s even though
they do not use exception handling, complicating the deployment to
non-glibc systems.

This wasn't really acceptable to us, so we/I started looking at how to
make binutils and gcc do the correct thing. Since libgcc_s is needed in
some cases (like with g++), the key issue seem to be to make the
toolchain better respect the weak references. Two things are needed
here:

 - gcc uses --as-needed on Linux systems around -lgcc_s, hoping that ld
   would do the right thing<tm>. Unfortunately it didn't for non-glibc
   systems, so these days only glibc 2.2+ systems get this flag. My
   first step was reinstating this flag for every system that supported
   it.

 - The wrong thing<tm> that ld did was to consided libgcc_s as needed,
   even though it only satisfied weak references. After a lot of
   horrifying digging through binutils internals, I managed to make it
   not consider DSOs with only weak references to it as needed.

Now this is now well behaved for this scenario, but is there some other
scenario that will break because of this? The documentation doesn't
mention how --as-needed and weak symbols interact, so it's currently
somewhat undefined. If not then I'd really appreciate if the patch
below could get merged.

There is a fixme in there about references from DSOs that I'm not sure
what's implied. I'm also not entirely clear on why ld's adding
DT_NEEDED to the program to satisfy unresolved symbols from a DSO.
Shouldn't it be up to the DSO to have whatever DT_NEEDED it requires to
fix up its dependencies?
Comment 1 Rich Felker 2012-03-22 03:19:00 UTC
Ping. I am the author of musl libc and this issue is seriously affecting myself and users of musl (on Linux); dynamic-linked programs intended to be extremely dependency-free (operate with only the musl loader/libc present on the target system) are getting an unwanted dependency on libgcc_s, and startup overhead is doubled even if it's present.

The proposed patch seems correct, so if it is, could it be committed and included in the next binutils release?
Comment 2 Pierre Ossman 2013-01-09 15:34:55 UTC
Created attachment 6806 [details]
binutils-2.21-as-needed-cleanup.patch

This patch exposed/cause another problem; the "as needed" cleanup doesn't restore the strtab properly. This resulted in an assertion later on (see bug 14862).

The problem was that it iterates over the symbols, checking which have added new entries in the strtab. So far so good, but it did it *after* it had restored the symbol table. This meant it would overlook any new symbols created, e.g. when a versioned symbol is added.

The attached patch does the strtab cleanup before restoring the symbol table, which avoids this issue.
Comment 3 H.J. Lu 2013-01-09 15:57:16 UTC
Please provide a small testcase.
Comment 4 Pierre Ossman 2013-01-10 12:23:02 UTC
Created attachment 6809 [details]
test case

Simple test case.

liba.so has a weak reference to libb.so and is linked using --as-needed. This should not result in a NEEDED entry in liba.so.
Comment 5 Alan Modra 2013-01-10 13:53:44 UTC
Created attachment 6810 [details]
A different patch for the strtab problem

Pierre, thanks for analysing the strtab problem.  Your patch in comment #2 looks good (but needs tweaking for mainline).  However, I think we can do better and avoid another pass over the symbols.
Comment 6 Sourceware Commits 2013-01-11 13:55:11 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	amodra@sourceware.org	2013-01-11 13:55:03

Modified files:
	bfd            : ChangeLog elf-bfd.h elf-strtab.c elflink.c 

Log message:
	PR ld/12549
	* elf-bfd.h (_bfd_elf_strtab_clear_refs): Declare.
	(_bfd_elf_strtab_clear_all_refs): Define.
	* elf-strtab.c (_bfd_elf_strtab_clear_refs): New function.
	(_bfd_elf_strtab_clear_all_refs): Delete.
	* elflink.c (elf_link_add_object_symbols): Clear out added
	strtab refs.  Correct handling of warning common symbols.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5900&r2=1.5901
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf-bfd.h.diff?cvsroot=src&r1=1.352&r2=1.353
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf-strtab.c.diff?cvsroot=src&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elflink.c.diff?cvsroot=src&r1=1.460&r2=1.461
Comment 7 Pierre Ossman 2013-01-11 15:26:09 UTC
Awesome.

Any verdict on the original issue and patch?
Comment 8 H.J. Lu 2013-01-14 15:40:37 UTC
(In reply to comment #4)
> Created attachment 6809 [details]
> test case
> 
> Simple test case.
> 
> liba.so has a weak reference to libb.so and is linked using --as-needed. This
> should not result in a NEEDED entry in liba.so.

I believe the linker behavior is correct. Adding --as-needed
shouldn't change if libb.so is added to the NEEDED entry in liba.so
since linking with libb.so changes the behavior of liba.so.  The
reason Linux doesn't have your problem is Linux uses GNU_EH_FRAME.
Comment 9 Rich Felker 2013-01-14 15:50:47 UTC
I agree there's room for different opinions here, but I believe --as-needed should not include the library when all it does is resolve weak references. This matches the static-linking behavior and, perhaps more importantly, matches the purpose of making the reference weak: the fact that you don't need or want the actual implementation linked in unless you're also linking something else that depended on it being present.

If it's not acceptable for --as-needed to have this behavior, then a different option to achieve the same thing is needed, and gcc needs to use that option with libgcc_s to prevent it from being linked unconditionally.
Comment 10 H.J. Lu 2013-01-14 17:04:03 UTC
Created attachment 6818 [details]
An example

You can change __register_frame_info in libgcc_s to
__register_frame_info_shared and put __register_frame_info
in libgcc.a which simply calls __register_frame_info_shared.
Comment 11 Rich Felker 2013-01-14 17:22:10 UTC
I agree that's possible as a workaround, but it seems to change the ABI for libgcc_s, which is probably not acceptable. And it's an extra layer of hackery needed to achieve the normal, sane result anybody would expect from --as-needed.
Comment 12 Sourceware Commits 2013-01-21 13:49:09 UTC
CVSROOT:	/cvs/src
Module name:	src
Branch: 	binutils-2_23-branch
Changes by:	amodra@sourceware.org	2013-01-21 13:48:53

Modified files:
	bfd            : ChangeLog bfdio.c cache.c elf-bfd.h 
	                 elf-strtab.c elf.c elf32-i386.c elf32-ppc.c 
	                 elf64-ppc.c elflink.c linker.c opncls.c 
	binutils       : ChangeLog readelf.c 
	gas            : ChangeLog dwarf2dbg.c sb.c write.c 
	gas/config     : tc-ppc.c tc-ppc.h 
	gas/testsuite  : ChangeLog 
	gas/testsuite/gas/cfi: cfi-ppc-1.d cfi-ppc-1.s cfi.exp 
	gas/testsuite/gas/ppc: 476.d 476.s a2.d a2.s altivec.d altivec.s 
	                       altivec_and_spe.d astest.d astest2.d 
	                       astest2_64.d astest64.d booke.d booke.s 
	                       cell.d cell.s common.d common.s e500.d 
	                       e500.s e500mc.d e500mc.s e500mc64_nop.d 
	                       e500mc64_nop.s e5500_nop.d e5500_nop.s 
	                       e6500.d e6500.s e6500_nop.d e6500_nop.s 
	                       machine.d power4.d power4.s power4_32.d 
	                       power4_32.s power6.d power6.s power7.d 
	                       power7.s ppc.exp ppc750ps.d ppc750ps.s 
	                       regnames.d simpshft.d test1elf32.d 
	                       test1elf64.d titan.d titan.s vle-reloc.s 
	                       vle-simple-1.s vle-simple-2.s 
	                       vle-simple-3.s vle-simple-4.s 
	                       vle-simple-5.s vle-simple-6.s vle.s vsx.d 
	                       vsx.s 
	include/opcode : ChangeLog ppc.h 
	ld             : ChangeLog ldexp.c ldexp.h ldlang.c ldmain.c 
	                 lexsup.c plugin.c plugin.h 
	ld/emultempl   : elf32.em 
	ld/testsuite   : ChangeLog 
	ld/testsuite/ld-gc: pr13683.d 
	ld/testsuite/ld-plugin: plugin-2.d plugin-4.d 
	ld/testsuite/ld-powerpc: apuinfo-nul.rd apuinfo.rd plt1.d 
	                         powerpc.exp relax.d relaxr.d sdadyn.d 
	                         tls.d tls.g tls.t tls32.d tls32.g 
	                         tls32.t tlsexe.d tlsexe.g tlsexe.r 
	                         tlsexe.t tlsexe32.d tlsexe32.g 
	                         tlsexe32.r tlsexe32.t tlsexetoc.d 
	                         tlsexetoc.g tlsexetoc.r tlsexetoc.t 
	                         tlsmark.d tlsmark32.d tlsopt1.d 
	                         tlsopt1_32.d tlsopt2.d tlsopt2_32.d 
	                         tlsopt3.d tlsopt3_32.d tlsopt4.d 
	                         tlsopt4_32.d tlsso.d tlsso.g tlsso.r 
	                         tlsso.t tlsso32.d tlsso32.g tlsso32.r 
	                         tlsso32.t tlstoc.d tlstoc.g tlstoc.t 
	                         tlstocso.d tlstocso.g tlstocso.t 
	                         tocopt.out 
	opcodes        : ChangeLog ppc-dis.c ppc-opc.c 
Added files:
	gas/testsuite/gas/ppc: altivec2.d altivec2.s 

Log message:
	PR 12549
	PR 14493
	PR 14567
	PR 14662
	PR 14758
	PR 14813
	PR 14904
	PR 14915
	PR 14926
	PR 14950
	PR 14962
	Apply mainline patches

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.5758.2.37&r2=1.5758.2.38
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/bfdio.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.33&r2=1.33.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/cache.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.41&r2=1.41.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf-bfd.h.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.343.2.2&r2=1.343.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf-strtab.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.16&r2=1.16.20.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.568&r2=1.568.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-i386.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.279.4.3&r2=1.279.4.4
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-ppc.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.318.4.1&r2=1.318.4.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf64-ppc.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.390.4.3&r2=1.390.4.4
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elflink.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.450.4.2&r2=1.450.4.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/linker.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.95&r2=1.95.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/opncls.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.69&r2=1.69.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1925.2.8&r2=1.1925.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/readelf.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.578.2.3&r2=1.578.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.4769.2.23&r2=1.4769.2.24
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/dwarf2dbg.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.116&r2=1.116.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/sb.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.20&r2=1.20.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/write.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.151&r2=1.151.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-ppc.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.184&r2=1.184.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-ppc.h.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.45&r2=1.45.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2057.2.19&r2=1.2057.2.20
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/cfi/cfi-ppc-1.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.3&r2=1.3.16.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/cfi/cfi-ppc-1.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.36.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/cfi/cfi.exp.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.27&r2=1.27.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/altivec2.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=NONE&r2=1.2.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/altivec2.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/476.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.4&r2=1.4.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/476.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.3&r2=1.3.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/a2.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.6&r2=1.6.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/a2.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.3&r2=1.3.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/altivec.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.6&r2=1.6.24.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/altivec.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.40.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/altivec_and_spe.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.12.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/astest.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.4&r2=1.4.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/astest2.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.6&r2=1.6.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/astest2_64.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.4&r2=1.4.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/astest64.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.4&r2=1.4.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/booke.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.14&r2=1.14.12.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/booke.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.7&r2=1.7.12.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/cell.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.18.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/cell.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.18.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/common.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2.12.1&r2=1.2.12.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/common.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1.18.1&r2=1.1.18.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/e500.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.8&r2=1.8.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/e500.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.3&r2=1.3.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/e500mc.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.6&r2=1.6.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/e500mc.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.12.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/e500mc64_nop.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/e500mc64_nop.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/e5500_nop.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/e5500_nop.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/e6500.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1.2.1&r2=1.1.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/e6500.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/e6500_nop.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/e6500_nop.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/machine.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.36.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/power4.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.7.8.1&r2=1.7.8.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/power4.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2.30.1&r2=1.2.30.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/power4_32.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.14.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/power4_32.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.14.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/power6.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.6&r2=1.6.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/power6.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.6&r2=1.6.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/power7.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.4.8.1&r2=1.4.8.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/power7.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.4.8.1&r2=1.4.8.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/ppc.exp.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.29&r2=1.29.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/ppc750ps.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.18.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/ppc750ps.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.18.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/regnames.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.18.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/simpshft.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1.1.1&r2=1.1.1.1.46.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/test1elf32.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.5&r2=1.5.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/test1elf64.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.6&r2=1.6.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/titan.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/titan.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/vle-reloc.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/vle-simple-1.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/vle-simple-2.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/vle-simple-3.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/vle-simple-4.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/vle-simple-5.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/vle-simple-6.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/vle.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/vsx.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/ppc/vsx.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/include/opcode/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.466.4.4&r2=1.466.4.5
http://sourceware.org/cgi-bin/cvsweb.cgi/src/include/opcode/ppc.h.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.44&r2=1.44.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2470.2.14&r2=1.2470.2.15
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ldexp.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.101.2.1&r2=1.101.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ldexp.h.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.31.2.1&r2=1.31.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ldlang.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.397.2.3&r2=1.397.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ldmain.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.165&r2=1.165.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/lexsup.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.133.2.1&r2=1.133.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/plugin.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.45&r2=1.45.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/plugin.h.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.10&r2=1.10.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/emultempl/elf32.em.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.229.2.1&r2=1.229.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1579.2.15&r2=1.1579.2.16
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-gc/pr13683.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.3&r2=1.3.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-plugin/plugin-2.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-plugin/plugin-4.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/apuinfo-nul.rd.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/apuinfo.rd.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.5&r2=1.5.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/plt1.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.20.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/powerpc.exp.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.40&r2=1.40.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/relax.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.3&r2=1.3.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/relaxr.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.3&r2=1.3.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/sdadyn.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.24.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tls.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.30.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tls.g.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.38.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tls.t.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.36.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tls32.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.30.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tls32.g.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.38.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tls32.t.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.38.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsexe.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.10&r2=1.10.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsexe.g.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.10&r2=1.10.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsexe.r.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.31&r2=1.31.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsexe.t.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.3&r2=1.3.38.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsexe32.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.10&r2=1.10.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsexe32.g.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.6&r2=1.6.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsexe32.r.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.20&r2=1.20.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsexe32.t.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.3&r2=1.3.24.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsexetoc.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.11&r2=1.11.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsexetoc.g.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.10&r2=1.10.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsexetoc.r.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.32&r2=1.32.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsexetoc.t.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.3&r2=1.3.36.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsmark.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsmark32.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsopt1.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsopt1_32.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsopt2.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsopt2_32.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsopt3.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsopt3_32.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsopt4.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsopt4_32.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsso.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.10&r2=1.10.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsso.g.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.9&r2=1.9.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsso.r.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.33&r2=1.33.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsso.t.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.36.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsso32.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.16&r2=1.16.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsso32.g.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.10&r2=1.10.20.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsso32.r.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.25&r2=1.25.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlsso32.t.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.4&r2=1.4.24.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlstoc.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.4&r2=1.4.30.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlstoc.g.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.36.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlstoc.t.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.38.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlstocso.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.9&r2=1.9.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlstocso.g.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.9&r2=1.9.18.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tlstocso.t.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.2&r2=1.2.36.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-powerpc/tocopt.out.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1&r2=1.1.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1831.2.20&r2=1.1831.2.21
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/ppc-dis.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.59&r2=1.59.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/ppc-opc.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.147.2.2&r2=1.147.2.3
Comment 13 Sourceware Commits 2013-02-18 10:40:27 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	amodra@sourceware.org	2013-02-18 10:40:19

Modified files:
	bfd            : ChangeLog elf-bfd.h elf-strtab.c elflink.c 

Log message:
	PR ld/12549
	* elf-bfd.h (_bfd_elf_strtab_clear_refs): Delete.
	(_bfd_elf_strtab_clear_all_refs): Declare.
	(_bfd_elf_strtab_resize): Declare.
	* elf-strtab.c (_bfd_elf_strtab_clear_refs): Delete.
	(_bfd_elf_strtab_clear_all_refs): New function.
	(_bfd_elf_strtab_resize): Likewise.
	* elflink.c (elf_link_add_object_symbols): Use _bfd_elf_strtab_resize.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5971&r2=1.5972
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf-bfd.h.diff?cvsroot=src&r1=1.360&r2=1.361
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf-strtab.c.diff?cvsroot=src&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elflink.c.diff?cvsroot=src&r1=1.469&r2=1.470
Comment 14 Sourceware Commits 2013-02-18 11:31:29 UTC
CVSROOT:	/cvs/src
Module name:	src
Branch: 	binutils-2_23-branch
Changes by:	amodra@sourceware.org	2013-02-18 11:31:19

Modified files:
	bfd            : ChangeLog elf-bfd.h elf-strtab.c elflink.c 

Log message:
	PR ld/12549
	* elf-bfd.h (_bfd_elf_strtab_clear_refs): Delete.
	(_bfd_elf_strtab_clear_all_refs): Declare.
	(_bfd_elf_strtab_resize): Declare.
	* elf-strtab.c (_bfd_elf_strtab_clear_refs): Delete.
	(_bfd_elf_strtab_clear_all_refs): New function.
	(_bfd_elf_strtab_resize): Likewise.
	* elflink.c (elf_link_add_object_symbols): Use _bfd_elf_strtab_resize.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.5758.2.46&r2=1.5758.2.47
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf-bfd.h.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.343.2.4&r2=1.343.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf-strtab.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.16.20.1&r2=1.16.20.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elflink.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.450.4.3&r2=1.450.4.4
Comment 15 Rich Felker 2013-02-18 16:22:08 UTC
It would be really nice if the bug tracker messages for addressing/resolving bugs actually contained an explanation of the resolution rather than cryptic references to implementation internals which are meaningless to somebody not already familiar with the codebase. If I stumbled across this bug tracker entry while experiencing this problem, I would have no idea from the messages just posted whether the bug was fixed.
Comment 16 Sourceware Commits 2013-03-18 02:47:08 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	amodra@sourceware.org	2013-03-18 02:47:03

Modified files:
	bfd            : ChangeLog elflink.c 
	ld             : ChangeLog ld.texinfo 
	ld/testsuite   : ChangeLog 
	ld/testsuite/ld-elf: pr14862.out 

Log message:
	PR ld/12549
	bfd/
	* elflink.c (elf_link_add_object_symbols): Exclude weak refs when
	considering whether an --as-needed library is needed.
	ld/
	* ld.texinfo (--as-needed): Update.
	ld/testsuite/
	* ld-elf/pr14862.out: Expect no output.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5991&r2=1.5992
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elflink.c.diff?cvsroot=src&r1=1.472&r2=1.473
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&r1=1.2569&r2=1.2570
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ld.texinfo.diff?cvsroot=src&r1=1.294&r2=1.295
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1695&r2=1.1696
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-elf/pr14862.out.diff?cvsroot=src&r1=1.1&r2=1.2
Comment 17 Alan Modra 2013-03-18 03:46:09 UTC
Fixed mainline
Comment 18 Rose Garcia 2013-09-15 14:19:23 UTC
Created attachment 7198 [details]
as-needed patch for binutils 2.23.2

as of binutils 2.23.2, this issue still exists

gcc 4.5.4, 4.7.3 (and probably all others as well) fail to build during target library compilation because libgcc_s.so.1 is getting used unconditionally, despite --as-needed being passed.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58427

if libgcc_s.so happens to be installed already, this bug will go unnoticed.
in my case, the first gcc is built with --disable-shared, so no libgcc_s.so is installed.

applying an extract of the original patch makes the gcc compilation error (and the inclusion of libgcc_s) go away.
Comment 19 Rose Garcia 2013-09-15 14:20:22 UTC
as described in the last comment
Comment 20 Alan Modra 2013-09-23 23:48:34 UTC
Won't fix on the 2.23 branch, but should be fixed with 2.24.
Comment 21 Colin Watson 2013-10-07 12:27:44 UTC
This appears to have caused a number of packages using Gnulib to fail their test suites:

  https://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00017.html

I suspect this actually needs to be fixed in Gnulib rather than in ld, but I've seen it in enough places that I thought it might be worth a reference here in case people from other distributions are trying to work out what's going on.