public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][gold] PR 21054: Fix GOT when global symbols are forced to local visibility
@ 2017-01-18 18:23 Vladimir Radosavljevic
  2017-01-19  8:35 ` Aurelien Jarno
  2017-01-24  1:19 ` Cary Coutant
  0 siblings, 2 replies; 4+ messages in thread
From: Vladimir Radosavljevic @ 2017-01-18 18:23 UTC (permalink / raw)
  To: binutils; +Cc: ccoutant, Petar Jovanovic

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

Don't add global symbol that requires GOT entry to the dynamic symbol table if it is forced to local visibility.

Regards,
Vladimir

ChangeLog -

gold/
	PR gold/21054
	* mips.cc (Mips_got_info::record_global_got_symbol): Don't add symbol
	to the dynamic symbol table if it is forced to local visibility.
	(Target_mips::do_finalize_sections): Don't add __RLD_MAP symbol to the
	dynamic symbol table if it is forced to local visibility.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: PR21054.patch --]
[-- Type: text/x-patch; name="PR21054.patch", Size: 954 bytes --]

diff --git a/gold/mips.cc b/gold/mips.cc
index 4f50574..ca3dd00 100644
--- a/gold/mips.cc
+++ b/gold/mips.cc
@@ -5627,7 +5627,7 @@ Mips_got_info<size, big_endian>::record_global_got_symbol(
     mips_sym->set_got_not_only_for_calls();
 
   // A global symbol in the GOT must also be in the dynamic symbol table.
-  if (!mips_sym->needs_dynsym_entry())
+  if (!mips_sym->needs_dynsym_entry() && !mips_sym->is_forced_local())
     {
       switch (mips_sym->visibility())
         {
@@ -9781,7 +9781,8 @@ Target_mips<size, big_endian>::do_finalize_sections(Layout* layout,
                                             elfcpp::STV_DEFAULT, 0,
                                             false, false);
 
-        rld_map->set_needs_dynsym_entry();
+        if (!rld_map->is_forced_local())
+          rld_map->set_needs_dynsym_entry();
 
         if (!parameters->options().pie())
           // This member holds the absolute address of the debug pointer.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][gold] PR 21054: Fix GOT when global symbols are forced to local visibility
  2017-01-18 18:23 [PATCH][gold] PR 21054: Fix GOT when global symbols are forced to local visibility Vladimir Radosavljevic
@ 2017-01-19  8:35 ` Aurelien Jarno
  2017-01-24  1:19 ` Cary Coutant
  1 sibling, 0 replies; 4+ messages in thread
From: Aurelien Jarno @ 2017-01-19  8:35 UTC (permalink / raw)
  To: Vladimir Radosavljevic; +Cc: binutils, ccoutant, Petar Jovanovic

On 2017-01-18 18:23, Vladimir Radosavljevic wrote:
> Don't add global symbol that requires GOT entry to the dynamic symbol table if it is forced to local visibility.
> 
> Regards,
> Vladimir
> 
> ChangeLog -
> 
> gold/
> 	PR gold/21054
> 	* mips.cc (Mips_got_info::record_global_got_symbol): Don't add symbol
> 	to the dynamic symbol table if it is forced to local visibility.
> 	(Target_mips::do_finalize_sections): Don't add __RLD_MAP symbol to the
> 	dynamic symbol table if it is forced to local visibility.

Thanks for the quick patch. I confirm it fixes the original issue, that
is systemd crashing when built with gold. Also note that the problem
also affects the 2.28 branch, so the patch would have to be backported
after commited to master.

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][gold] PR 21054: Fix GOT when global symbols are forced to local visibility
  2017-01-18 18:23 [PATCH][gold] PR 21054: Fix GOT when global symbols are forced to local visibility Vladimir Radosavljevic
  2017-01-19  8:35 ` Aurelien Jarno
@ 2017-01-24  1:19 ` Cary Coutant
  2017-01-24  1:23   ` Cary Coutant
  1 sibling, 1 reply; 4+ messages in thread
From: Cary Coutant @ 2017-01-24  1:19 UTC (permalink / raw)
  To: Vladimir Radosavljevic; +Cc: binutils, Petar Jovanovic

> Don't add global symbol that requires GOT entry to the dynamic symbol table if it is forced to local visibility.
>
> gold/
>         PR gold/21054
>         * mips.cc (Mips_got_info::record_global_got_symbol): Don't add symbol
>         to the dynamic symbol table if it is forced to local visibility.
>         (Target_mips::do_finalize_sections): Don't add __RLD_MAP symbol to the
>         dynamic symbol table if it is forced to local visibility.

Committed. Thanks!

-cary

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][gold] PR 21054: Fix GOT when global symbols are forced to local visibility
  2017-01-24  1:19 ` Cary Coutant
@ 2017-01-24  1:23   ` Cary Coutant
  0 siblings, 0 replies; 4+ messages in thread
From: Cary Coutant @ 2017-01-24  1:23 UTC (permalink / raw)
  To: Vladimir Radosavljevic; +Cc: binutils, Petar Jovanovic

>> Don't add global symbol that requires GOT entry to the dynamic symbol table if it is forced to local visibility.
>>
>> gold/
>>         PR gold/21054
>>         * mips.cc (Mips_got_info::record_global_got_symbol): Don't add symbol
>>         to the dynamic symbol table if it is forced to local visibility.
>>         (Target_mips::do_finalize_sections): Don't add __RLD_MAP symbol to the
>>         dynamic symbol table if it is forced to local visibility.
>
> Committed. Thanks!

Also backported to 2.28.

-cary

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-24  1:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-18 18:23 [PATCH][gold] PR 21054: Fix GOT when global symbols are forced to local visibility Vladimir Radosavljevic
2017-01-19  8:35 ` Aurelien Jarno
2017-01-24  1:19 ` Cary Coutant
2017-01-24  1:23   ` Cary Coutant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).