Bug 13245 - PREVAILING_DEF reported too often.
Summary: PREVAILING_DEF reported too often.
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Cary Coutant
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-01 15:48 UTC by Jan Hubicka
Modified: 2011-12-19 21:14 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Hubicka 2011-10-01 15:48:56 UTC
Consider the following:
jh@evans:/abuild/jh/trunk-install/bin> cat t.C
__attribute__ ((noinline))
inline int test()
{
}

void
test3()
{
  test();
}
jh@evans:/abuild/jh/trunk-install/bin> cat t2.C

__attribute__ ((noinline))
inline int test()
{
}

extern void test3();
int test2()
{
  test();
  test3();
}
jh@evans:/abuild/jh/trunk-install/bin> ./gcc t.C --shared -o libt.so -fPIC
jh@evans:/abuild/jh/trunk-install/bin> ./gcc t2.C --shared -o t2.so -fPIC -L ./ -lt -flto -fuse-linker-plugin --save-temps
[Leaving LTRANS /tmp/cc4hfq9X.args]
[Leaving LTRANS t2.so.ltrans.out]
[Leaving LTRANS /tmp/ccGWs68c.args]
[Leaving LTRANS t2.so.ltrans0.o]
jh@evans:/abuild/jh/trunk-install/bin> more ./*.res
1
t2.o 3
164 929187be PREVAILING_DEF _Z4testv
172 929187be PREVAILING_DEF_IRONLY_EXP _Z5test2v
176 929187be RESOLVED_DYN _Z5test3v
jh@evans:/abuild/jh/trunk-install/bin> 

Here the function test is comdat both in libt.so and t2.so. 
In t2.so we would like to make it static because doing so improves dynamic linking time (i.e. the function in question don't need to be resolved at all).
We can't want to do that in libt.so because that one is not LTOed.

This would happen if linker returned PREVAILING_DEF_IRONLY_EXP for _Z4testv instead of PREVAILING_DEF.  I think this is consistent with documentation of it - i.e. symbol is IRONLY within current DSO but exported. It does not matter much whether we know if libt.so will bind to it or not.

I.e. I would like the output to be equivalent to:
jh@evans:/abuild/jh/trunk-install/bin> ./gcc t2.C --shared -o t2.so -fPIC -L ./  -flto -fuse-linker-plugin --save-temps
[Leaving LTRANS /tmp/ccJrd58U.args]
[Leaving LTRANS t2.so.ltrans.out]
[Leaving LTRANS /tmp/ccyRSkGM.args]
[Leaving LTRANS t2.so.ltrans0.o]
jh@evans:/abuild/jh/trunk-install/bin> more ./*.res
1
t2.o 3
164 72744d77 PREVAILING_DEF_IRONLY_EXP _Z4testv
172 72744d77 PREVAILING_DEF_IRONLY_EXP _Z5test2v
176 72744d77 UNDEF _Z5test3v
jh@evans:/abuild/jh/trunk-install/bin> nm -D t2.so
                 w _Jv_RegisterClasses
000000000000055c T _Z5test2v
                 U _Z5test3v
00000000000018c0 A __bss_start
                 w __cxa_finalize
                 w __gmon_start__
00000000000018c0 A _edata
00000000000018d0 A _end
00000000000005b8 T _fini
0000000000000448 T _init
Comment 1 Jan Hubicka 2011-10-01 15:55:21 UTC
Note that this blocks mozilla build with -flto -fprofile-generate
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45375
Comment 2 Octoploid 2011-10-02 08:19:49 UTC
I cannot reproduce this issue:

 % gcc t2.C --shared -o t2.so -fPIC -L ./ -lt -flto --save-temps
[Leaving LTRANS /tmp/ccVZyHEi.args]
[Leaving LTRANS t2.so.ltrans.out]
[Leaving LTRANS /tmp/ccqiTieX.args]
[Leaving LTRANS t2.so.ltrans0.o]

 % < t2.res
1
t2.o 2
172 54331a27 PREVAILING_DEF_IRONLY_EXP _Z5test2v
176 54331a27 RESOLVED_DYN _Z5test3v

 % nm t2.so
0000000000001618 d _DYNAMIC
0000000000001830 d _GLOBAL_OFFSET_TABLE_
                 w _Jv_RegisterClasses
000000000000055c t _Z4testv.local.0.2237
000000000000054c T _Z5test2v
                 U _Z5test3v
0000000000001860 d __JCR_END__
...
Comment 3 hubicka 2011-10-02 10:10:58 UTC
> I cannot reproduce this issue:

Sorry, it is because mainline still contains the hack for COMDAT handling (I
diseabled it in my tree to verify that new IRONLY solution works).  You need to
extend the testcases to take address of the inline function  so the hack is
ineffective.

Honza
Comment 4 hubicka 2011-10-02 10:48:55 UTC
> Sorry, it is because mainline still contains the hack for COMDAT handling (I
> diseabled it in my tree to verify that new IRONLY solution works).  You need to
> extend the testcases to take address of the inline function  so the hack is
> ineffective.
Actually adding address would just convolute the testcase in a way that the intended
optimization would be impossible (we can not unshare the two comdats since we do not
know if the oher library takes address of test, too).

Probably easiest way to reproduce is to update to today tree (you need v2 plugin API
support I just comitted) and disable the comdat hack.  The problem hits without comdat
hack, too (like is the case of Mozilla with -fprofile-generate) but it is more difficult
to produce a testcase.

BTW I am starting to wonder by linker results in PREVAILING_DEF at all.  When I know
Iam going to link with a shared library that exports the comdat, I can just optimize
it out. So at least w/o LTO it would make sense for me if linker just preemted it
to the dynamic linking then.

Honza

Index: lto-streamer-out.c
===================================================================
--- lto-streamer-out.c	(revision 179423)
+++ lto-streamer-out.c	(working copy)
@@ -1396,7 +1396,7 @@ produce_symtab (struct output_block *ob,
       if (DECL_EXTERNAL (node->decl))
 	continue;
       if (DECL_COMDAT (node->decl)
-	  && cgraph_comdat_can_be_unshared_p (node))
+	  && cgraph_comdat_can_be_unshared_p (node) && 0)
 	continue;
       if ((node->alias && !node->thunk.alias) || node->global.inlined_to)
 	continue;
@@ -1408,7 +1408,7 @@ produce_symtab (struct output_block *ob,
       if (!DECL_EXTERNAL (node->decl))
 	continue;
       if (DECL_COMDAT (node->decl)
-	  && cgraph_comdat_can_be_unshared_p (node))
+	  && cgraph_comdat_can_be_unshared_p (node) && 0)
 	continue;
       if ((node->alias && !node->thunk.alias) || node->global.inlined_to)
 	continue;
@@ -1427,7 +1427,7 @@ produce_symtab (struct output_block *ob,
       if (DECL_COMDAT (vnode->decl)
 	  && !vnode->force_output
 	  && vnode->finalized 
-	  && DECL_VIRTUAL_P (vnode->decl))
+	  && DECL_VIRTUAL_P (vnode->decl) && 0)
 	continue;
       if (vnode->alias && !vnode->alias_of)
 	continue;
@@ -1441,7 +1441,7 @@ produce_symtab (struct output_block *ob,
       if (DECL_COMDAT (vnode->decl)
 	  && !vnode->force_output
 	  && vnode->finalized 
-	  && DECL_VIRTUAL_P (vnode->decl))
+	  && DECL_VIRTUAL_P (vnode->decl) && 0)
 	continue;
       if (vnode->alias && !vnode->alias_of)
 	continue;
Comment 5 Octoploid 2011-10-02 13:01:38 UTC
What about the following naive patch?

diff --git a/gold/plugin.cc b/gold/plugin.cc
index b5880a1..d999254 100644
--- a/gold/plugin.cc
+++ b/gold/plugin.cc
@@ -889,10 +889,10 @@ Pluginobj::get_symbol_resolution_info(int nsyms,
             res = LDPR_RESOLVED_EXEC;
           else if (lsym->object()->pluginobj() == this)
            {
-             if (is_referenced_from_outside(lsym))
-               res = LDPR_PREVAILING_DEF;
-             else if (is_visible_from_outside(lsym))
+             if (is_visible_from_outside(lsym))
                res = ldpr_prevailing_def_ironly_exp;
+             else if (is_referenced_from_outside(lsym))
+               res = LDPR_PREVAILING_DEF;
              else
                res = LDPR_PREVAILING_DEF_IRONLY;
            }
@@ -910,10 +910,10 @@ Pluginobj::get_symbol_resolution_info(int nsyms,
             res = LDPR_PREEMPTED_REG;
           else if (lsym->object() == static_cast<const Object*>(this))
            {
-             if (is_referenced_from_outside(lsym))
-               res = LDPR_PREVAILING_DEF;
-             else if (is_visible_from_outside(lsym))
+             if (is_visible_from_outside(lsym))
                res = ldpr_prevailing_def_ironly_exp;
+             else if (is_referenced_from_outside(lsym))
+               res = LDPR_PREVAILING_DEF;
              else
                res = LDPR_PREVAILING_DEF_IRONLY;
            }


It fixes the issue:

 % gcc t2.C --shared -o t2.so -fPIC -L ./ -lt -flto --save-temps
[Leaving LTRANS /tmp/ccHFvJ09.args]
[Leaving LTRANS t2.so.ltrans.out]
[Leaving LTRANS /tmp/ccwhzNf0.args]
[Leaving LTRANS t2.so.ltrans0.o]

 % < t2.res
1
t2.o 3
164 e040fa02d1822684 PREVAILING_DEF_IRONLY_EXP _Z4testv
172 e040fa02d1822684 PREVAILING_DEF_IRONLY_EXP _Z5test2v
176 e040fa02d1822684 RESOLVED_DYN _Z5test3v

 % nm -CD t2.so
                 w _Jv_RegisterClasses
                 w test()
000000000000056c T test2()
                 U test3()
0000000000001898 A __bss_start
                 w __cxa_finalize
                 w __gmon_start__
0000000000001898 A _edata
000000000000189c A _end
0000000000000584 T _fini
00000000000004a0 T _init

It also survived bootstrap-lto of gcc and an "-flto -fno-fat-lto-objects" build
of Firefox.
Comment 6 hubicka 2011-10-02 15:22:07 UTC
> http://sourceware.org/bugzilla/show_bug.cgi?id=13245
> 
> --- Comment #5 from Octoploid <cryptooctoploid at gmail dot com> 2011-10-02 13:01:38 UTC ---
> What about the following naive patch?
> 
> diff --git a/gold/plugin.cc b/gold/plugin.cc
> index b5880a1..d999254 100644
> --- a/gold/plugin.cc
> +++ b/gold/plugin.cc
> @@ -889,10 +889,10 @@ Pluginobj::get_symbol_resolution_info(int nsyms,
>              res = LDPR_RESOLVED_EXEC;
>            else if (lsym->object()->pluginobj() == this)
>             {
> -             if (is_referenced_from_outside(lsym))
> -               res = LDPR_PREVAILING_DEF;
> -             else if (is_visible_from_outside(lsym))
> +             if (is_visible_from_outside(lsym))
>                 res = ldpr_prevailing_def_ironly_exp;
> +             else if (is_referenced_from_outside(lsym))
> +               res = LDPR_PREVAILING_DEF;

I think the condiitonals would need to be swapped at least. When the symbol is used from .o file it has
to be LDPR_PREVAILING_DEF no matter if it is exported or not.
> 
> It also survived bootstrap-lto of gcc and an "-flto -fno-fat-lto-objects" build
> of Firefox.

Cool!  If you happen to have a lot of memory (15GB), you may try if it solves the -fprofile-generate -flto
problem.
In meantime I suceeded building FDO+LTO firefox with -fprofile-generate -fno-lto train run (that makes more sense
anyway, I am trying to debug the other just to be sure that there are no more problems in this area)

Honza
Comment 7 Octoploid 2011-10-02 18:41:58 UTC
(In reply to comment #6)
> > Cool!  If you happen to have a lot of memory (15GB), you may try if it solves
> the -fprofile-generate -flto problem.

Yes, it does solve the problem here (I have 8GB of RAM and used a
large swapfile on my SSD. It took ~10 minutes to output all ltrans.o 
files).

> In meantime I suceeded building FDO+LTO firefox with -fprofile-generate
> -fno-lto train run (that makes more sense
> anyway, I am trying to debug the other just to be sure that there are no more
> problems in this area)

-fprofile-generate should set -fno-lto automatically IMHO.
Comment 8 hubicka 2011-10-02 20:50:50 UTC
> 
> Yes, it does solve the problem here (I have 8GB of RAM and used a
> large swapfile on my SSD. It took ~10 minutes to output all ltrans.o 
> files).

I am surprised it converge with 8GB of RAM at all...

> 
> -fprofile-generate should set -fno-lto automatically IMHO.

I suggested this at one point and richi didn't like it, forgot why.

Thanks for looking into this! It is good to know this is "the last bug" WRT LTO linking of Mozilla ;)

Honza
Comment 9 Cary Coutant 2011-10-03 21:50:21 UTC
> Here the function test is comdat both in libt.so and t2.so. 
> In t2.so we would like to make it static because doing so improves dynamic
> linking time (i.e. the function in question don't need to be resolved at all).
> We can't want to do that in libt.so because that one is not LTOed.
> 
> This would happen if linker returned PREVAILING_DEF_IRONLY_EXP for _Z4testv
> instead of PREVAILING_DEF.  I think this is consistent with documentation of it
> - i.e. symbol is IRONLY within current DSO but exported. It does not matter
> much whether we know if libt.so will bind to it or not.

So do you want the linker to ignore references from shared objects completely, or only if the reference is a (pre-empted) definition? I could make the former happen with the following patch:

diff --git a/gold/resolve.cc b/gold/resolve.cc
index 03288ec..2a68876 100644
--- a/gold/resolve.cc
+++ b/gold/resolve.cc
@@ -296,7 +296,7 @@ Symbol_table::resolve(Sized_symbol<size>* to,
 
   // Record if we've seen this symbol in a real ELF object (i.e., the
   // symbol is referenced from outside the world known to the plugin).
-  if (object->pluginobj() == NULL)
+  if (object->pluginobj() == NULL && !object->is_dynamic())
     to->set_in_real_elf();
 
   // If we're processing replacement files, allow new symbols to override

That would be consistent with your view that linking with -lt should give the same results as without -lt.

For the latter, I'd just have to add a test for whether or not the "from" symbol is a definition.

-cary
Comment 10 hubicka 2011-10-04 09:17:43 UTC
> http://sourceware.org/bugzilla/show_bug.cgi?id=13245
> 
> --- Comment #9 from Cary Coutant <ccoutant at google dot com> 2011-10-03 21:50:21 UTC ---
> > Here the function test is comdat both in libt.so and t2.so. 
> > In t2.so we would like to make it static because doing so improves dynamic
> > linking time (i.e. the function in question don't need to be resolved at all).
> > We can't want to do that in libt.so because that one is not LTOed.
> > 
> > This would happen if linker returned PREVAILING_DEF_IRONLY_EXP for _Z4testv
> > instead of PREVAILING_DEF.  I think this is consistent with documentation of it
> > - i.e. symbol is IRONLY within current DSO but exported. It does not matter
> > much whether we know if libt.so will bind to it or not.
> 
> So do you want the linker to ignore references from shared objects completely,
> or only if the reference is a (pre-empted) definition? I could make the former
> happen with the following patch:

Hi,
I am by far not confident in this area, but I personally don't see much difference for
compiler to know whether the symbol will be bound by dynamic linker to other DSO or
may be bound.  So I guess ignoring symbols from shared libraries should work well,
since they will all end up PREVAILING_DEF_IRONLY_EXP.

Note that while looking at differences in resolution files in between gold and
GNU LD I noticed that gold reports some symbols as UNDEF that are PREEMPTED_DYN
for GNU LD.  It is harmless, because internally GCC handles both prety much
equally, but it seems wrong?

Honza
Comment 11 rguenther 2011-10-04 09:24:22 UTC
On Sun, 2 Oct 2011, Jan Hubicka wrote:

> > 
> > Yes, it does solve the problem here (I have 8GB of RAM and used a
> > large swapfile on my SSD. It took ~10 minutes to output all ltrans.o 
> > files).
> 
> I am surprised it converge with 8GB of RAM at all...
> 
> > 
> > -fprofile-generate should set -fno-lto automatically IMHO.
> 
> I suggested this at one point and richi didn't like it, forgot why.
> 
> Thanks for looking into this! It is good to know this is "the last bug" WRT LTO linking of Mozilla ;)

Well, it sounded like a hack.  I'd rather have a way to force LTO
profiling at least.

Richard.
Comment 12 hubicka 2011-10-04 09:41:40 UTC
> http://sourceware.org/bugzilla/show_bug.cgi?id=13245
> 
> --- Comment #11 from rguenther at suse dot de 2011-10-04 09:24:22 UTC ---
> On Sun, 2 Oct 2011, Jan Hubicka wrote:
> 
> > > 
> > > Yes, it does solve the problem here (I have 8GB of RAM and used a
> > > large swapfile on my SSD. It took ~10 minutes to output all ltrans.o 
> > > files).
> > 
> > I am surprised it converge with 8GB of RAM at all...
> > 
> > > 
> > > -fprofile-generate should set -fno-lto automatically IMHO.
> > 
> > I suggested this at one point and richi didn't like it, forgot why.
> > 
> > Thanks for looking into this! It is good to know this is "the last bug" WRT LTO linking of Mozilla ;)
> 
> Well, it sounded like a hack.  I'd rather have a way to force LTO
> profiling at least.

Instrumentation at linktime is in my longer term TODO, but it will be fun - we will need to pickle
CFG at compile time and with -fprofile-generate decide on placement of instrumentation at WPA time
making the actual modifications at ltrans time.
It is not that hard to do, but needs some work - i.e. cleanup what gcov has already, because gcov
has pretty much all needed, but not readily useable within compiler and not with the fancier features
like automatic correction.

Also if we get variant of LIPO into mainline, we will be stuck with the instrumentation at compile time
too.

Honza
Comment 13 Octoploid 2011-10-15 06:44:54 UTC
Any update on this?
The issue just got fixed on the bfd side: http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elflink.c.diff?cvsroot=src&r1=1.423&r2=1.424
Comment 14 Sourceware Commits 2011-10-18 00:25:57 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	ccoutant@sourceware.org	2011-10-18 00:25:53

Modified files:
	gold           : ChangeLog plugin.cc resolve.cc symtab.h 
	gold/testsuite : plugin_test_2.sh 

Log message:
	PR gold/13245
	* plugin.cc (is_visible_from_outside): Check for symbols
	referenced from dynamic objects.
	* resolve.cc (Symbol_table::resolve): Don't count references
	from dynamic objects as references from real ELF files.
	* testsuite/plugin_test_2.sh: Adjust expected result.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/ChangeLog.diff?cvsroot=src&r1=1.839&r2=1.840
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/plugin.cc.diff?cvsroot=src&r1=1.51&r2=1.52
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/resolve.cc.diff?cvsroot=src&r1=1.63&r2=1.64
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/symtab.h.diff?cvsroot=src&r1=1.125&r2=1.126
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/testsuite/plugin_test_2.sh.diff?cvsroot=src&r1=1.2&r2=1.3
Comment 15 Octoploid 2011-11-02 11:35:39 UTC
fixed
Comment 16 Sourceware Commits 2011-12-19 21:14:52 UTC
CVSROOT:	/cvs/src
Module name:	src
Branch: 	binutils-2_22-branch
Changes by:	ian@sourceware.org	2011-12-19 21:14:40

Modified files:
	gold           : ChangeLog Makefile.am Makefile.in configure 
	                 configure.ac dwarf_reader.cc expression.cc 
	                 fileread.cc gold.cc i386.cc incremental.cc 
	                 incremental.h layout.cc options.cc options.h 
	                 output.cc output.h plugin.cc powerpc.cc 
	                 readsyms.cc resolve.cc script-sections.cc 
	                 script.cc script.h sparc.cc symtab.cc symtab.h 
	                 x86_64.cc 
	gold/testsuite : Makefile.in plugin_test_2.sh script_test_2.t 

Log message:
	Copy from mainline to binutils 2.22 branch:
	
	2011-12-17  Cary Coutant  <ccoutant@google.com>
	
	* dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
	* resolve.cc (Symbol_table::resolve): Likewise.
	* i386.cc (Target_i386::do_code_fill): Use char constants for nop
	arrays.
	* x86_64.cc (Target_x86_64::do_code_fill): Likewise.
	
	2011-10-31  Cary Coutant  <ccoutant@google.com>
	
	PR gold/13023
	* expression.cc (Expression::eval_with_dot): Add
	is_section_dot_assignment parameter.
	(Expression::eval_maybe_dot): Likewise.  Adjust value when rhs is
	absolute and assigning to dot within a section.
	* script-sections.cc
	(Output_section_element_assignment::set_section_addresses): Pass
	dot_section to set_if_absolute.
	(Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
	as is_section_dot_assignment flag to eval_with_dot.
	(Output_section_element_dot_assignment::set_section_addresses):
	Likewise.
	* script.cc (Symbol_assignment::set_if_absolute): Add dot_section
	parameter.  Also set value if relative to dot_section; set the
	symbol's output_section.
	* script.h (Expression::eval_with_dot): Add is_section_dot_assignment
	parameter.  Adjust all callers.
	(Expression::eval_maybe_dot): Likewise.
	(Symbol_assignment::set_if_absolute): Add dot_section parameter.
	Adjust all callers.
	* testsuite/script_test_2.t: Test assignment of an absolute value
	to dot within an output section element.
	
	2011-10-31  Cary Coutant  <ccoutant@google.com>
	
	* options.h (class General_options): Add --[no-]gnu-unique options.
	* symtab.cc (Symbol_table::sized_write_globals): Convert
	STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
	
	2011-10-31  Cary Coutant  <ccoutant@google.com>
	
	PR gold/13359
	* i386.cc (Target_i386::Relocate::relocate_tls): Remove
	unnecessary assertion.
	* x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
	
	2011-10-31 Sriraman Tallam  <tmsriram@google.com>
	
	* symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
	gc_mark_symbol.
	* symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
	gc_mark_symbol.
	Change to just keep the section associated with symbol.
	(Symbol_table::add_from_relobj): Mark symbols as not garbage when
	they are externally visible and --export-dynamic is turned on.
	(Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
	
	2011-10-19  Ian Lance Taylor  <iant@google.com>
	
	PR gold/13163
	* script-sections.cc
	(Output_section_element_dot_assignment::needs_output_section): New
	function.
	
	2011-10-19  Ian Lance Taylor  <iant@google.com>
	
	PR gold/13204
	* layout.cc (Layout::segment_precedes): Don't assert failure if a
	--section-start option was seen.
	* options.h (General_options::any_section_start): New function.
	
	2011-10-18  Cary Coutant  <ccoutant@google.com>
	
	* output.cc (posix_fallocate): Return 0 on success, errno on failure.
	(Output_file::map_no_anonymous): Check for non-zero
	return code from posix_fallocate.
	
	2011-10-17  Cary Coutant  <ccoutant@google.com>
	
	PR gold/13245
	* plugin.cc (is_visible_from_outside): Check for symbols
	referenced from dynamic objects.
	* resolve.cc (Symbol_table::resolve): Don't count references
	from dynamic objects as references from real ELF files.
	* testsuite/plugin_test_2.sh: Adjust expected result.
	
	2011-10-17  Cary Coutant  <ccoutant@google.com>
	
	* readsyms.cc (Read_symbols::run): Don't queue an unblocker
	task for members of lib groups.
	
	2011-10-17  Cary Coutant  <ccoutant@google.com>
	
	PR gold/13288
	* fileread.cc (File_read::find_view): Add assert.
	(File_read::make_view): Move bounds check (replace with assert)...
	(File_read::find_or_make_view): ... to here.
	
	2011-10-12  Cary Coutant  <ccoutant@google.com>
	
	* output.cc (Output_file::open_base_file): Handle case where
	::read returns less than requested size.
	
	2011-10-10  Cary Coutant  <ccoutant@google.com>
	
	* incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
	Initialize defined_count_.
	(Sized_relobj_incr::do_add_symbols): Count defined symbols.
	(Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
	(Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
	(Sized_incr_dynobj::do_add_symbols): Count defined symbols.
	(Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
	* incremental.h (Sized_relobj_incr::defined_count_): New data
	member.
	(Sized_incr_dynobj::defined_count_): New data member.
	* plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
	Return zeroes instead of internal error.
	
	2011-10-10  Cary Coutant  <ccoutant@google.com>
	
	PR gold/13249
	* output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
	(Output_reloc::symbol_value): Return PLT offset if flag is set.
	* output.h (class Output_reloc): Add use_plt_offset flag.
	(Output_reloc::type_): Adjust size of bit field.
	(Output_reloc::use_plt_offset_): New bit field.
	(class Output_data_reloc): Adjust all calls to Output_reloc_type.
	(Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
	flag.  Adjust all callers.
	* x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
	creating RELATIVE relocations.
	
	2011-10-03   Diego Novillo  <dnovillo@google.com>
	
	* options.cc (parse_uint): Fix dereference of RETVAL.
	
	2011-09-29  Cary Coutant  <ccoutant@google.com>
	
	* incremental.cc (Sized_incremental_binary::do_process_got_plt):
	Check for NULL.
	* symtab.cc (Symbol_table::add_from_relobj): Ignore version
	symbols during incremental update.
	(Symbol_table::add_from_dynobj): Likewise.
	
	2011-09-26  Cary Coutant  <ccoutant@google.com>
	
	* gold.cc (queue_initial_tasks): Move option checks ...
	* options.cc (General_options::finalize): ... to here. Disable
	some options; make others fatal.
	
	2011-09-23  Simon Baldwin  <simonb@google.com>
	
	* configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
	configuration options.
	* configure: Regenerate.
	* Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.824.2.6&r2=1.824.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/Makefile.am.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.62&r2=1.62.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/Makefile.in.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.89&r2=1.89.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/configure.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.69&r2=1.69.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/configure.ac.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.66&r2=1.66.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/dwarf_reader.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.33&r2=1.33.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/expression.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.18&r2=1.18.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/fileread.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.74&r2=1.74.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/gold.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.94&r2=1.94.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/i386.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.141&r2=1.141.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/incremental.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.47&r2=1.47.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/incremental.h.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.28&r2=1.28.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/layout.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.220&r2=1.220.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/options.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.114&r2=1.114.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/options.h.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.169.2.1&r2=1.169.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/output.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.159&r2=1.159.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/output.h.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.128&r2=1.128.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/plugin.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.48.2.1&r2=1.48.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/powerpc.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.39&r2=1.39.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/readsyms.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.51&r2=1.51.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/resolve.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.63&r2=1.63.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/script-sections.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.53&r2=1.53.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/script.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.84&r2=1.84.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/script.h.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.37&r2=1.37.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/sparc.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.48.2.1&r2=1.48.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/symtab.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.159.2.1&r2=1.159.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/symtab.h.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.125&r2=1.125.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/x86_64.cc.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.139&r2=1.139.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/testsuite/Makefile.in.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.191.2.2&r2=1.191.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/testsuite/plugin_test_2.sh.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.2&r2=1.2.8.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/testsuite/script_test_2.t.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.3&r2=1.3.14.1