[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/19] fuzz: Make fork_fuzz.ld compatible with LLVM's LLD
From: |
Thomas Huth |
Subject: |
[PULL 11/19] fuzz: Make fork_fuzz.ld compatible with LLVM's LLD |
Date: |
Tue, 10 Nov 2020 12:11:24 +0100 |
From: Daniele Buono <dbuono@linux.vnet.ibm.com>
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>
Message-Id: <20201105221905.1350-2-dbuono@linux.vnet.ibm.com>
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Thomas Huth <thuth@redhat.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.18.4
- [PULL 00/19] qtests, gitlab, s390x and misc patches, Thomas Huth, 2020/11/10
- [PULL 01/19] meson: always include contrib/libvhost-user, Thomas Huth, 2020/11/10
- [PULL 03/19] device-crash-test: Check if path is actually an executable file, Thomas Huth, 2020/11/10
- [PULL 04/19] qtest: Fix bad printf format specifiers, Thomas Huth, 2020/11/10
- [PULL 05/19] tests/qtest/tpm: Remove redundant check in the tpm_test_swtpm_test(), Thomas Huth, 2020/11/10
- [PULL 02/19] tests/vm: update openbsd to release 6.8, Thomas Huth, 2020/11/10
- [PULL 06/19] gitlab-ci: Drop generic cache rule, Thomas Huth, 2020/11/10
- [PULL 07/19] MAINTAINERS: Add gitlab-pipeline-status script to GitLab CI section, Thomas Huth, 2020/11/10
- [PULL 11/19] fuzz: Make fork_fuzz.ld compatible with LLVM's LLD,
Thomas Huth <=
- [PULL 10/19] scripts/oss-fuzz: give all fuzzers -target names, Thomas Huth, 2020/11/10
- [PULL 09/19] docs/fuzz: update fuzzing documentation post-meson, Thomas Huth, 2020/11/10
- [PULL 12/19] configure: surface deprecated targets in the help output, Thomas Huth, 2020/11/10
- [PULL 13/19] gitlab: publish the docs built during CI, Thomas Huth, 2020/11/10
- [PULL 14/19] gitlab: force enable docs build in Fedora, Ubuntu, Debian, Thomas Huth, 2020/11/10
- [PULL 08/19] docs/fuzz: rST-ify the fuzzing documentation, Thomas Huth, 2020/11/10
- [PULL 15/19] docs: add "page source" link to sphinx documentation, Thomas Huth, 2020/11/10
- [PULL 16/19] fuzz: add virtio-blk fuzz target, Thomas Huth, 2020/11/10
- [PULL 17/19] qtest: Update references to parse_escape() in comments, Thomas Huth, 2020/11/10
- [PULL 18/19] s390x: fix clang 11 warnings in cpu_models.c, Thomas Huth, 2020/11/10