• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


コミットメタ情報

リビジョン0dc9a308a1ec9675bf6b33bae9e8b1faa0bad9ed (tree)
日時2017-04-25 05:42:33
作者H.J. Lu <hjl.tools@gmai...>
コミッターH.J. Lu

ログメッセージ

i386: Force symbol dynamic if it isn't undefined weak

Force symbol dynamic if it isn't undefined weak. Generate R_386_RELATIVE
relocation for R_386_GOT32 relocation against non-dynamic symbol in PIC.

PR ld/21402
* elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
undefined weak symbol, don't make it dynamic.
(elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
set no_finish_dynamic_symbol and generate R_386_RELATIVE
relocation for R_386_GOT32.

変更サマリ

差分

--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,14 @@
11 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
22
3+ PR ld/21402
4+ * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
5+ undefined weak symbol, don't make it dynamic.
6+ (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
7+ set no_finish_dynamic_symbol and generate R_386_RELATIVE
8+ relocation for R_386_GOT32.
9+
10+2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
11+
312 PR ld/21425
413 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
514
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2748,7 +2748,8 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
27482748 Undefined weak syms won't yet be marked as dynamic. */
27492749 if (h->dynindx == -1
27502750 && !h->forced_local
2751- && !resolved_to_zero)
2751+ && !resolved_to_zero
2752+ && h->root.type == bfd_link_hash_undefweak)
27522753 {
27532754 if (! bfd_elf_link_record_dynamic_symbol (info, h))
27542755 return FALSE;
@@ -2867,14 +2868,11 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
28672868 int tls_type = elf_i386_hash_entry(h)->tls_type;
28682869
28692870 /* Make sure this symbol is output as a dynamic symbol.
2870- Undefined weak syms won't yet be marked as dynamic.
2871- PR ld/21402: If this symbol isn't undefined weak symbol,
2872- don't make it dynamic in PIE. */
2871+ Undefined weak syms won't yet be marked as dynamic. */
28732872 if (h->dynindx == -1
28742873 && !h->forced_local
28752874 && !resolved_to_zero
2876- && (h->root.type == bfd_link_hash_undefweak
2877- || !bfd_link_pie (info)))
2875+ && h->root.type == bfd_link_hash_undefweak)
28782876 {
28792877 if (! bfd_elf_link_record_dynamic_symbol (info, h))
28802878 return FALSE;
@@ -3035,7 +3033,8 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
30353033 Undefined weak syms won't yet be marked as dynamic. */
30363034 if (h->dynindx == -1
30373035 && !h->forced_local
3038- && !resolved_to_zero)
3036+ && !resolved_to_zero
3037+ && h->root.type == bfd_link_hash_undefweak)
30393038 {
30403039 if (! bfd_elf_link_record_dynamic_symbol (info, h))
30413040 return FALSE;
@@ -4315,10 +4314,10 @@ r_386_got32:
43154314 if (h->dynindx == -1
43164315 && !h->forced_local
43174316 && h->root.type != bfd_link_hash_undefweak
4318- && bfd_link_pie (info))
4317+ && bfd_link_pic (info))
43194318 {
43204319 /* PR ld/21402: If this symbol isn't dynamic
4321- in PIE, generate R_386_RELATIVE here. */
4320+ in PIC, generate R_386_RELATIVE here. */
43224321 eh->no_finish_dynamic_symbol = 1;
43234322 relative_reloc = TRUE;
43244323 }