diff options
author | Rong Xu <xur@google.com> | 2015-02-18 11:19:21 -0800 |
---|---|---|
committer | Rong Xu <xur@google.com> | 2015-02-18 11:19:21 -0800 |
commit | aff326d7fffe9111be0900d433c6de6661c48af3 (patch) | |
tree | be2a526d4f321842e461c514d5e07cbea7a04fdb | |
parent | 51d71fd2cc99f309cb792cc48ae910baeb92b2a0 (diff) | |
download | toolchain_binutils-aff326d7fffe9111be0900d433c6de6661c48af3.tar.gz toolchain_binutils-aff326d7fffe9111be0900d433c6de6661c48af3.tar.bz2 toolchain_binutils-aff326d7fffe9111be0900d433c6de6661c48af3.zip |
[2.24][2.25] Fix race condition causing assert
Backport trunk commit 635aa that fixes race condition causing assert in
Eh_frame_hdr::do_sized_write().
2014-09-23 Taiju Tsuiki <tzik@google.com>
Cary Coutant <ccoutant@google.com>
gold/
* gold.cc (queue_final_tasks): Add Write_sections_task as a
* blocker
on input_sections_blocker.
* layout.cc (Write_sections_task::locks): Unblock
input_sections_blocker_.
* layout.h (Write_sections_task::Write_sections_task): Add
input_sections_blocker.
* testsuite/Makefile.am (exception_x86_64_bnd_test): Add
* gcctestdir/ld
to DEPENDENCIES.
* testsuite/Makefile.in: Regenerate.
Change-Id: I17a0f2aaf565b775f92f4806c4abcbea5d2dd803
-rw-r--r-- | binutils-2.24/gold/ChangeLog | 13 | ||||
-rw-r--r-- | binutils-2.24/gold/gold.cc | 3 | ||||
-rw-r--r-- | binutils-2.24/gold/layout.cc | 2 | ||||
-rw-r--r-- | binutils-2.24/gold/layout.h | 3 | ||||
-rw-r--r-- | binutils-2.24/gold/testsuite/Makefile.am | 5 | ||||
-rw-r--r-- | binutils-2.24/gold/testsuite/Makefile.in | 6 | ||||
-rw-r--r-- | binutils-2.25/gold/gold.cc | 3 | ||||
-rw-r--r-- | binutils-2.25/gold/layout.cc | 2 | ||||
-rw-r--r-- | binutils-2.25/gold/layout.h | 3 | ||||
-rw-r--r-- | binutils-2.25/gold/testsuite/Makefile.am | 5 | ||||
-rw-r--r-- | binutils-2.25/gold/testsuite/Makefile.in | 6 |
11 files changed, 32 insertions, 19 deletions
diff --git a/binutils-2.24/gold/ChangeLog b/binutils-2.24/gold/ChangeLog index 089a34a8..88371a20 100644 --- a/binutils-2.24/gold/ChangeLog +++ b/binutils-2.24/gold/ChangeLog @@ -6,6 +6,19 @@ (Layout::create_executable_stack_info): Warn when -z noexecstack is given but some inputs require executable stack. +2014-09-23 Taiju Tsuiki <tzik@google.com> + Cary Coutant <ccoutant@google.com> + + * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker + on input_sections_blocker. + * layout.cc (Write_sections_task::locks): Unblock + input_sections_blocker_. + * layout.h (Write_sections_task::Write_sections_task): Add + input_sections_blocker. + * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld + to DEPENDENCIES. + * testsuite/Makefile.in: Regenerate. + 2013-11-22 Cary Coutant <ccoutant@google.com> * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree diff --git a/binutils-2.24/gold/gold.cc b/binutils-2.24/gold/gold.cc index 4de9289b..7c724659 100644 --- a/binutils-2.24/gold/gold.cc +++ b/binutils-2.24/gold/gold.cc @@ -809,6 +809,8 @@ queue_final_tasks(const General_options& options, if (!any_postprocessing_sections) { input_sections_blocker = new Task_token(true); + // Write_symbols_task, Relocate_tasks. + input_sections_blocker->add_blocker(); input_sections_blocker->add_blockers(input_objects->number_of_relobjs()); } @@ -837,6 +839,7 @@ queue_final_tasks(const General_options& options, // Queue a task to write out the output sections. workqueue->queue(new Write_sections_task(layout, of, output_sections_blocker, + input_sections_blocker, final_blocker)); // Queue a task to write out everything else. diff --git a/binutils-2.24/gold/layout.cc b/binutils-2.24/gold/layout.cc index b0a90263..0aa83981 100644 --- a/binutils-2.24/gold/layout.cc +++ b/binutils-2.24/gold/layout.cc @@ -5525,6 +5525,8 @@ void Write_sections_task::locks(Task_locker* tl) { tl->add(this, this->output_sections_blocker_); + if (this->input_sections_blocker_ != NULL) + tl->add(this, this->input_sections_blocker_); tl->add(this, this->final_blocker_); } diff --git a/binutils-2.24/gold/layout.h b/binutils-2.24/gold/layout.h index 792b748d..a8d1adf9 100644 --- a/binutils-2.24/gold/layout.h +++ b/binutils-2.24/gold/layout.h @@ -1455,9 +1455,11 @@ class Write_sections_task : public Task public: Write_sections_task(const Layout* layout, Output_file* of, Task_token* output_sections_blocker, + Task_token* input_sections_blocker, Task_token* final_blocker) : layout_(layout), of_(of), output_sections_blocker_(output_sections_blocker), + input_sections_blocker_(input_sections_blocker), final_blocker_(final_blocker) { } @@ -1482,6 +1484,7 @@ class Write_sections_task : public Task const Layout* layout_; Output_file* of_; Task_token* output_sections_blocker_; + Task_token* input_sections_blocker_; Task_token* final_blocker_; }; diff --git a/binutils-2.24/gold/testsuite/Makefile.am b/binutils-2.24/gold/testsuite/Makefile.am index e518240b..d57730ea 100644 --- a/binutils-2.24/gold/testsuite/Makefile.am +++ b/binutils-2.24/gold/testsuite/Makefile.am @@ -2252,10 +2252,9 @@ endif DEFAULT_TARGET_X86_64 if DEFAULT_TARGET_X86_64 check_PROGRAMS += exception_x86_64_bnd_test exception_x86_64_bnd_test_SOURCES = exception_test_main.cc -exception_x86_64_bnd_test_DEPENDENCIES = exception_x86_64_bnd_1.o \ - exception_x86_64_bnd_2.o +exception_x86_64_bnd_test_DEPENDENCIES = gcctestdir/ld exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS) -exception_x86_64_bnd_test_LDADD = $(exception_x86_64_bnd_test_DEPENDENCIES) +exception_x86_64_bnd_test_LDADD = exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o exception_x86_64_bnd_1.o: exception_test_1.cc gcctestdir/as $(CXXCOMPILE) -c -fpic -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $< exception_x86_64_bnd_2.o: exception_test_2.cc gcctestdir/as diff --git a/binutils-2.24/gold/testsuite/Makefile.in b/binutils-2.24/gold/testsuite/Makefile.in index 44d5acc9..d36ae7bf 100644 --- a/binutils-2.24/gold/testsuite/Makefile.in +++ b/binutils-2.24/gold/testsuite/Makefile.in @@ -2607,11 +2607,9 @@ LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncvar_LDFLAGS = -Bgcctestdir/ -Wl,-R,. @GCC_TRUE@@IFUNC_TRUE@@NATIVE_LINKER_TRUE@ifuncvar_LDADD = ifuncvar.so @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_SOURCES = exception_test_main.cc -@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_DEPENDENCIES = exception_x86_64_bnd_1.o \ -@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_x86_64_bnd_2.o - +@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_DEPENDENCIES = gcctestdir/ld exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS) -@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDADD = $(exception_x86_64_bnd_test_DEPENDENCIES) +@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDADD = exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 all: $(BUILT_SOURCES) diff --git a/binutils-2.25/gold/gold.cc b/binutils-2.25/gold/gold.cc index bdfb33d9..4833aec7 100644 --- a/binutils-2.25/gold/gold.cc +++ b/binutils-2.25/gold/gold.cc @@ -808,8 +808,6 @@ queue_final_tasks(const General_options& options, if (!any_postprocessing_sections) { input_sections_blocker = new Task_token(true); - // Write_symbols_task, Relocate_tasks. - input_sections_blocker->add_blocker(); input_sections_blocker->add_blockers(input_objects->number_of_relobjs()); } @@ -838,7 +836,6 @@ queue_final_tasks(const General_options& options, // Queue a task to write out the output sections. workqueue->queue(new Write_sections_task(layout, of, output_sections_blocker, - input_sections_blocker, final_blocker)); // Queue a task to write out everything else. diff --git a/binutils-2.25/gold/layout.cc b/binutils-2.25/gold/layout.cc index 7cbbe39b..32ac384a 100644 --- a/binutils-2.25/gold/layout.cc +++ b/binutils-2.25/gold/layout.cc @@ -5534,8 +5534,6 @@ void Write_sections_task::locks(Task_locker* tl) { tl->add(this, this->output_sections_blocker_); - if (this->input_sections_blocker_ != NULL) - tl->add(this, this->input_sections_blocker_); tl->add(this, this->final_blocker_); } diff --git a/binutils-2.25/gold/layout.h b/binutils-2.25/gold/layout.h index 032f5f33..7c0113cd 100644 --- a/binutils-2.25/gold/layout.h +++ b/binutils-2.25/gold/layout.h @@ -1454,11 +1454,9 @@ class Write_sections_task : public Task public: Write_sections_task(const Layout* layout, Output_file* of, Task_token* output_sections_blocker, - Task_token* input_sections_blocker, Task_token* final_blocker) : layout_(layout), of_(of), output_sections_blocker_(output_sections_blocker), - input_sections_blocker_(input_sections_blocker), final_blocker_(final_blocker) { } @@ -1483,7 +1481,6 @@ class Write_sections_task : public Task const Layout* layout_; Output_file* of_; Task_token* output_sections_blocker_; - Task_token* input_sections_blocker_; Task_token* final_blocker_; }; diff --git a/binutils-2.25/gold/testsuite/Makefile.am b/binutils-2.25/gold/testsuite/Makefile.am index 35cd0139..dd06d5fd 100644 --- a/binutils-2.25/gold/testsuite/Makefile.am +++ b/binutils-2.25/gold/testsuite/Makefile.am @@ -2380,9 +2380,10 @@ endif DEFAULT_TARGET_X86_64 if DEFAULT_TARGET_X86_64 check_PROGRAMS += exception_x86_64_bnd_test exception_x86_64_bnd_test_SOURCES = exception_test_main.cc -exception_x86_64_bnd_test_DEPENDENCIES = gcctestdir/ld exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o +exception_x86_64_bnd_test_DEPENDENCIES = exception_x86_64_bnd_1.o \ + exception_x86_64_bnd_2.o exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS) -exception_x86_64_bnd_test_LDADD = exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o +exception_x86_64_bnd_test_LDADD = $(exception_x86_64_bnd_test_DEPENDENCIES) exception_x86_64_bnd_1.o: exception_test_1.cc gcctestdir/as $(CXXCOMPILE) -c -fpic -Bgcctestdir/ -Wa,-madd-bnd-prefix -o $@ $< exception_x86_64_bnd_2.o: exception_test_2.cc gcctestdir/as diff --git a/binutils-2.25/gold/testsuite/Makefile.in b/binutils-2.25/gold/testsuite/Makefile.in index 8fbb6446..fed610f1 100644 --- a/binutils-2.25/gold/testsuite/Makefile.in +++ b/binutils-2.25/gold/testsuite/Makefile.in @@ -2732,9 +2732,11 @@ LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ehdr_start_test_5_LDFLAGS = -Bgcctestdir/ @GCC_TRUE@@NATIVE_LINKER_TRUE@ehdr_start_test_5_LDADD = @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_SOURCES = exception_test_main.cc -@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_DEPENDENCIES = gcctestdir/ld exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o +@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_DEPENDENCIES = exception_x86_64_bnd_1.o \ +@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_x86_64_bnd_2.o + @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDFLAGS = $(exception_test_LDFLAGS) -@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDADD = exception_x86_64_bnd_1.o exception_x86_64_bnd_2.o +@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_x86_64_bnd_test_LDADD = $(exception_x86_64_bnd_test_DEPENDENCIES) @DEFAULT_TARGET_I386_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 @DEFAULT_TARGET_X86_64_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@SPLIT_DEFSYMS = --defsym __morestack=0x100 --defsym __morestack_non_split=0x200 all: $(BUILT_SOURCES) |