• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

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

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

コミットメタ情報

リビジョンfbdf9406b0589e9b8bbfbbed606f3fff2d060b3c (tree)
日時2015-12-08 18:11:58
作者Jan Beulich <jbeulich@nove...>
コミッターJan Beulich

ログメッセージ

ELF: don't re-order SHF_FILE symbols

.file directives may be used to identify the scope of local symbols,
the purpose of which gets subverted when re-ordering them. Only allow
the first of them to be moved to the first position.

変更サマリ

差分

--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
1+2015-12-08 Jan Beulich <jbeulich@suse.com>
2+
3+ * config/obj-elf.c (elf_file_symbol): Tighten condition for
4+ moving BSF_FILE symbols.
5+
16 2015-12-08 DJ Delorie <dj@redhat.com>
27
38 * config/rl78-parse.y: Make all branches relaxable via
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -282,14 +282,17 @@ elf_file_symbol (const char *s, int appfile)
282282
283283 symbol_get_bfdsym (sym)->flags |= BSF_FILE;
284284
285- if (symbol_rootP != sym)
285+ if (symbol_rootP != sym
286+ && (symbol_rootP->bsym == NULL
287+ || !(symbol_rootP->bsym->flags & BSF_FILE)))
286288 {
287289 symbol_remove (sym, &symbol_rootP, &symbol_lastP);
288290 symbol_insert (sym, symbol_rootP, &symbol_rootP, &symbol_lastP);
291+ }
292+
289293 #ifdef DEBUG
290- verify_symbol_chain (symbol_rootP, symbol_lastP);
294+ verify_symbol_chain (symbol_rootP, symbol_lastP);
291295 #endif
292- }
293296 }
294297
295298 #ifdef NEED_ECOFF_DEBUG
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,10 @@
1+2015-12-08 Jan Beulich <jbeulich@suse.com>
2+
3+ * gas/elf/file-2.s, gas/elf/file-2.d: New.
4+ * gas/elf/elf.exp: Run new test.
5+ * gas/elf/file.d: Adjust expectations.
6+ * gas/i386/ilp32/elf/file.d: Likewise.
7+
18 2015-12-04 Nick Clifton <nickc@redhat.com>
29
310 PR gas/19276
--- a/gas/testsuite/gas/elf/elf.exp
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -111,6 +111,7 @@ if { [is_elf_format] } then {
111111 run_dump_test "file"
112112 }
113113 }
114+ run_dump_test "file-2"
114115 setup_xfail "nds32*-*-*"
115116 run_dump_test "group0a"
116117 run_dump_test "group0b"
--- /dev/null
+++ b/gas/testsuite/gas/elf/file-2.d
@@ -0,0 +1,14 @@
1+#objdump: -t
2+#name: .file file names ordering
3+
4+.*: .*
5+
6+SYMBOL TABLE:
7+0+ l[ ]*df \*ABS\*[ ]+0+ file-2\.s
8+#...
9+0+ l[ ]*\.text[ ]+0+ local1
10+0+ l[ ]*df \*ABS\*[ ]+0+ aux-1\.s
11+0+ l[ ]*\.text[ ]+0+ local2
12+0+ l[ ]*df \*ABS\*[ ]+0+ aux-2\.s
13+0+ l[ ]*\.text[ ]+0+ local3
14+#pass
--- /dev/null
+++ b/gas/testsuite/gas/elf/file-2.s
@@ -0,0 +1,7 @@
1+ .file "file-2.s"
2+ .text
3+local1:
4+ .file "aux-1.s"
5+local2:
6+ .file "aux-2.s"
7+local3:
--- a/gas/testsuite/gas/elf/file.d
+++ b/gas/testsuite/gas/elf/file.d
@@ -4,15 +4,15 @@
44 .*: .*
55
66 SYMBOL TABLE:
7+0+ l[ ]*df \*ABS\*[ ]+0+ ~tilde
78 #...
8-0+ l[ ]*df \*ABS\*[ ]+0+ file\.s
9-0+ l[ ]*df \*ABS\*[ ]+0+ slash/data
10-0+ l[ ]*df \*ABS\*[ ]+0+ \{braces\}
11-0+ l[ ]*df \*ABS\*[ ]+0+ \[brackets\]
12-0+ l[ ]*df \*ABS\*[ ]+0+ /dir/file\.s
13-0+ l[ ]*df \*ABS\*[ ]+0+ :colon
14-0+ l[ ]*df \*ABS\*[ ]+0+ UPPER
15-0+ l[ ]*df \*ABS\*[ ]+0+ lower
169 0+ l[ ]*df \*ABS\*[ ]+0+ hash\#
17-0+ l[ ]*df \*ABS\*[ ]+0+ ~tilde
10+0+ l[ ]*df \*ABS\*[ ]+0+ lower
11+0+ l[ ]*df \*ABS\*[ ]+0+ UPPER
12+0+ l[ ]*df \*ABS\*[ ]+0+ :colon
13+0+ l[ ]*df \*ABS\*[ ]+0+ /dir/file\.s
14+0+ l[ ]*df \*ABS\*[ ]+0+ \[brackets\]
15+0+ l[ ]*df \*ABS\*[ ]+0+ \{braces\}
16+0+ l[ ]*df \*ABS\*[ ]+0+ slash/data
17+0+ l[ ]*df \*ABS\*[ ]+0+ file\.s
1818 #pass
--- a/gas/testsuite/gas/i386/ilp32/elf/file.d
+++ b/gas/testsuite/gas/i386/ilp32/elf/file.d
@@ -5,15 +5,15 @@
55 .*: .*
66
77 SYMBOL TABLE:
8+0+ l[ ]*df \*ABS\*[ ]+0+ ~tilde
89 #...
9-0+ l[ ]*df \*ABS\*[ ]+0+ file\.s
10-0+ l[ ]*df \*ABS\*[ ]+0+ slash/data
11-0+ l[ ]*df \*ABS\*[ ]+0+ \{braces\}
12-0+ l[ ]*df \*ABS\*[ ]+0+ \[brackets\]
13-0+ l[ ]*df \*ABS\*[ ]+0+ /dir/file\.s
14-0+ l[ ]*df \*ABS\*[ ]+0+ :colon
15-0+ l[ ]*df \*ABS\*[ ]+0+ UPPER
16-0+ l[ ]*df \*ABS\*[ ]+0+ lower
1710 0+ l[ ]*df \*ABS\*[ ]+0+ hash\#
18-0+ l[ ]*df \*ABS\*[ ]+0+ ~tilde
11+0+ l[ ]*df \*ABS\*[ ]+0+ lower
12+0+ l[ ]*df \*ABS\*[ ]+0+ UPPER
13+0+ l[ ]*df \*ABS\*[ ]+0+ :colon
14+0+ l[ ]*df \*ABS\*[ ]+0+ /dir/file\.s
15+0+ l[ ]*df \*ABS\*[ ]+0+ \[brackets\]
16+0+ l[ ]*df \*ABS\*[ ]+0+ \{braces\}
17+0+ l[ ]*df \*ABS\*[ ]+0+ slash/data
18+0+ l[ ]*df \*ABS\*[ ]+0+ file\.s
1919 #pass