リビジョン | 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.
@@ -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 | + | |
1 | 6 | 2015-12-08 DJ Delorie <dj@redhat.com> |
2 | 7 | |
3 | 8 | * config/rl78-parse.y: Make all branches relaxable via |
@@ -282,14 +282,17 @@ elf_file_symbol (const char *s, int appfile) | ||
282 | 282 | |
283 | 283 | symbol_get_bfdsym (sym)->flags |= BSF_FILE; |
284 | 284 | |
285 | - if (symbol_rootP != sym) | |
285 | + if (symbol_rootP != sym | |
286 | + && (symbol_rootP->bsym == NULL | |
287 | + || !(symbol_rootP->bsym->flags & BSF_FILE))) | |
286 | 288 | { |
287 | 289 | symbol_remove (sym, &symbol_rootP, &symbol_lastP); |
288 | 290 | symbol_insert (sym, symbol_rootP, &symbol_rootP, &symbol_lastP); |
291 | + } | |
292 | + | |
289 | 293 | #ifdef DEBUG |
290 | - verify_symbol_chain (symbol_rootP, symbol_lastP); | |
294 | + verify_symbol_chain (symbol_rootP, symbol_lastP); | |
291 | 295 | #endif |
292 | - } | |
293 | 296 | } |
294 | 297 | |
295 | 298 | #ifdef NEED_ECOFF_DEBUG |
@@ -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 | + | |
1 | 8 | 2015-12-04 Nick Clifton <nickc@redhat.com> |
2 | 9 | |
3 | 10 | PR gas/19276 |
@@ -111,6 +111,7 @@ if { [is_elf_format] } then { | ||
111 | 111 | run_dump_test "file" |
112 | 112 | } |
113 | 113 | } |
114 | + run_dump_test "file-2" | |
114 | 115 | setup_xfail "nds32*-*-*" |
115 | 116 | run_dump_test "group0a" |
116 | 117 | run_dump_test "group0b" |
@@ -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 |
@@ -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: |
@@ -4,15 +4,15 @@ | ||
4 | 4 | .*: .* |
5 | 5 | |
6 | 6 | SYMBOL TABLE: |
7 | +0+ l[ ]*df \*ABS\*[ ]+0+ ~tilde | |
7 | 8 | #... |
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 | |
16 | 9 | 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 | |
18 | 18 | #pass |
@@ -5,15 +5,15 @@ | ||
5 | 5 | .*: .* |
6 | 6 | |
7 | 7 | SYMBOL TABLE: |
8 | +0+ l[ ]*df \*ABS\*[ ]+0+ ~tilde | |
8 | 9 | #... |
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 | |
17 | 10 | 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 | |
19 | 19 | #pass |