Fix test errors when building with RELR. PiperOrigin-RevId: 623223777
diff --git a/centipede/dso_example/dso_example_test.sh b/centipede/dso_example/dso_example_test.sh index 349c491..a5c42b7 100755 --- a/centipede/dso_example/dso_example_test.sh +++ b/centipede/dso_example/dso_example_test.sh
@@ -39,6 +39,9 @@ centipede::maybe_set_var_to_executable_path \ TARGET_DSO "${CENTIPEDE_TEST_SRCDIR}/dso_example/fuzz_me.so" +centipede::maybe_set_var_to_executable_path \ + OBJDUMP "$(centipede::get_objdump_path)" + echo "Running the dso_example binary with dl_path_suffix; expecting it to pass" CENTIPEDE_RUNNER_FLAGS=":dl_path_suffix=/fuzz_me.so:" "${TARGET_BINARY}" @@ -48,6 +51,7 @@ centipede::ensure_empty_dir "${WD}" "${CENTIPEDE_BINARY}" --workdir "${WD}" --binary "${TARGET_BINARY} @@" \ --runner_dl_path_suffix "/fuzz_me.so" --coverage_binary "${TARGET_DSO}" \ + --objdump_path="${OBJDUMP}" \ --num_runs=100 2>&1 | tee "${LOG}" centipede::assert_fuzzing_success "${LOG}" @@ -63,6 +67,7 @@ --binary \ "LD_PRELOAD=${CENTIPEDE_RUNNER_NO_MAIN_SO} ${TARGET_BINARY_DLOPEN} @@" \ --runner_dl_path_suffix "/fuzz_me.so" --coverage_binary "${TARGET_DSO}" \ + --objdump_path="${OBJDUMP}" \ --num_runs=100 --fork_server=0 2>&1 | tee "${LOG}" centipede::assert_fuzzing_success "${LOG}"
diff --git a/centipede/testing/BUILD b/centipede/testing/BUILD index 17c4df6..0fe549c 100644 --- a/centipede/testing/BUILD +++ b/centipede/testing/BUILD
@@ -14,12 +14,9 @@ load(":build_defs.bzl", "centipede_fuzz_target") -package( - default_visibility = [ - "@com_google_fuzztest//centipede:__subpackages__", - ], - features = ["-enable_relr"], -) +package(default_visibility = [ + "@com_google_fuzztest//centipede:__subpackages__", +]) licenses(["notice"])
diff --git a/centipede/testing/trace_pc_test.sh b/centipede/testing/trace_pc_test.sh index bd56b57..c424da7 100755 --- a/centipede/testing/trace_pc_test.sh +++ b/centipede/testing/trace_pc_test.sh
@@ -28,11 +28,16 @@ centipede::maybe_set_var_to_executable_path \ TARGET_BINARY "${CENTIPEDE_TEST_SRCDIR}/testing/abort_fuzz_target_trace_pc" +centipede::maybe_set_var_to_executable_path \ + OBJDUMP "$(centipede::get_objdump_path)" + + # Run fuzzing until the first crash. WD="${TEST_TMPDIR}/WD" LOG="${TEST_TMPDIR}/log" centipede::ensure_empty_dir "${WD}" "${CENTIPEDE_BINARY}" --binary="${TARGET_BINARY}" --workdir="${WD}" \ + --objdump_path="${OBJDUMP}" \ --exit_on_crash=1 --seed=1 \ 2>&1 |tee "${LOG}"