[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/6] fuzz: Make fork_fuzz.ld compatible with LLVM's LLD
From: |
Daniele Buono |
Subject: |
[PATCH v2 1/6] fuzz: Make fork_fuzz.ld compatible with LLVM's LLD |
Date: |
Fri, 23 Oct 2020 16:06:39 -0400 |
LLVM's linker, LLD, supports the keyword "INSERT AFTER", starting with
version 11.
However, when multiple sections are defined in the same "INSERT AFTER",
they are added in a reversed order, compared to BFD's LD.
This patch makes fork_fuzz.ld generic enough to work with both linkers.
Each section now has its own "INSERT AFTER" keyword, so proper ordering is
defined between the sections added.
Signed-off-by: Daniele Buono <dbuono@linux.vnet.ibm.com>
---
tests/qtest/fuzz/fork_fuzz.ld | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/fuzz/fork_fuzz.ld b/tests/qtest/fuzz/fork_fuzz.ld
index bfb667ed06..cfb88b7fdb 100644
--- a/tests/qtest/fuzz/fork_fuzz.ld
+++ b/tests/qtest/fuzz/fork_fuzz.ld
@@ -16,6 +16,11 @@ SECTIONS
/* Lowest stack counter */
*(__sancov_lowest_stack);
}
+}
+INSERT AFTER .data;
+
+SECTIONS
+{
.data.fuzz_ordered :
{
/*
@@ -34,6 +39,11 @@ SECTIONS
*/
*(.bss._ZN6fuzzer3TPCE);
}
+}
+INSERT AFTER .data.fuzz_start;
+
+SECTIONS
+{
.data.fuzz_end : ALIGN(4K)
{
__FUZZ_COUNTERS_END = .;
@@ -43,4 +53,4 @@ SECTIONS
* Don't overwrite the SECTIONS in the default linker script. Instead insert
the
* above into the default script
*/
-INSERT AFTER .data;
+INSERT AFTER .data.fuzz_ordered;
--
2.17.1
- [PATCH v2 0/6] Add support for Control-Flow Integrity, Daniele Buono, 2020/10/23
- [PATCH v2 1/6] fuzz: Make fork_fuzz.ld compatible with LLVM's LLD,
Daniele Buono <=
- [PATCH v2 2/6] configure: avoid new clang 11+ warnings, Daniele Buono, 2020/10/23
- Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings, Thomas Huth, 2020/10/24
- Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings, Paolo Bonzini, 2020/10/26
- Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings, Daniele Buono, 2020/10/26
- Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings, Paolo Bonzini, 2020/10/26
- Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings, Daniele Buono, 2020/10/26
- Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings, Peter Maydell, 2020/10/26
- Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings, Thomas Huth, 2020/10/27
- Re: [PATCH v2 2/6] configure: avoid new clang 11+ warnings, Cornelia Huck, 2020/10/27