@@ -181,10 +181,35 @@ endif
181181# ~259 MB of tree-sitter parse tables was mapped executable at runtime while the
182182# amd64 build of the same source mapped them R only. That is a large ROP gadget
183183# surface for data that is never executed, and it is invisible to section flags.
184+ #
185+ # -z relro + -z now finish the same job on the OTHER writable-but-shouldn't-be
186+ # region: the GOT. Both are free at runtime here (a static binary resolves
187+ # everything at link time, so there is no lazy binding left to pay for), and
188+ # they are added because the SHIPPED artifact measurably lacked the property --
189+ # not because the linker accepts the flags. Measured on this binary, built the
190+ # way .github/workflows/_build.yml builds the Linux release (STATIC=1, gcc 13.3
191+ # / GNU ld 2.42, Ubuntu 24.04 aarch64); PT_GNU_RELRO ends at 0x11DA0000 in both:
192+ #
193+ # without -z now: .got 0x11d9ec20+0x13c8, .got.plt 0x11d9ffe8+0x40
194+ # -> .got.plt ends at 0x11DA0028, i.e. 40 bytes PAST the
195+ # window: those GOT slots stayed writable for the whole
196+ # process lifetime, in every Linux binary we have shipped
197+ # with -z now: .got.plt folded into .got (0x11d9ec20+0x13c8, ends
198+ # 0x11D9FFE8) -> the whole GOT is inside the window and is
199+ # re-mapped read-only after startup
200+ #
201+ # -z relro is already this toolchain's default and changes nothing here; it is
202+ # named anyway so the property stops depending on one distro's spec file (the
203+ # musl/portable and glibc-floor images are different toolchains, and a default
204+ # is not a guarantee). A1c/A1d in scripts/ci/check-binary-composition.sh assert
205+ # the OUTCOME on the produced binary, because a flag the compiler accepts is
206+ # not evidence that the artifact gained anything -- the same reason A1 exists
207+ # next to the .note.GNU-stack annotation.
184208ELF_HARDENING_FLAGS :=
185209ifeq ($(IS_LINUX),yes)
186210ifneq ($(IS_MINGW),yes)
187- ELF_HARDENING_FLAGS := -Wl,-z,noexecstack -Wl,-z,separate-code
211+ ELF_HARDENING_FLAGS := -Wl,-z,noexecstack -Wl,-z,separate-code \
212+ -Wl,-z,relro -Wl,-z,now
188213endif
189214endif
190215
@@ -354,8 +379,10 @@ PIPELINE_SRCS = \
354379 src/pipeline/pass_similarity.c \
355380 src/pipeline/pass_semantic_edges.c \
356381 src/pipeline/pass_complexity.c \
382+ src/pipeline/pass_importance.c \
357383 src/pipeline/pass_cross_repo.c \
358384 src/pipeline/artifact.c \
385+ src/pipeline/pass_ensemble_routing.c \
359386 src/pipeline/pass_pkgmap.c
360387
361388# SimHash / MinHash module
@@ -559,7 +586,7 @@ TEST_DISCOVER_SRCS = \
559586
560587TEST_GRAPH_BUFFER_SRCS = tests/test_graph_buffer.c
561588
562- TEST_PIPELINE_SRCS = tests/test_registry.c tests/test_pipeline.c tests/test_cross_repo.c tests/test_fqn.c tests/test_route_canon.c tests/test_path_alias.c tests/test_configlink.c tests/test_infrascan.c tests/test_worker_pool.c tests/test_parallel.c tests/test_index_resilience.c tests/test_call_reference_contract.c tests/repro/repro_call_scope_usages.c tests/repro/repro_call_argument_usages.c tests/repro/repro_reference_precision.c tests/repro/repro_lexical_binding_precision.c tests/repro/repro_call_argument_matrix_a.c tests/repro/repro_call_argument_matrix_b.c tests/repro/repro_call_node_behaviors.c tests/repro/repro_language_registry.c tests/repro/repro_call_node_manifest.c tests/repro/repro_lsp_ordered_signatures.c tests/repro/repro_lsp_ordered_local.c tests/repro/repro_ts_overload_return_chains.c tests/repro/repro_harness_cleanup.c tests/repro/repro_runner_filter.c
589+ TEST_PIPELINE_SRCS = tests/test_registry.c tests/test_pipeline.c tests/test_importance.c tests/ test_cross_repo.c tests/test_fqn.c tests/test_route_canon.c tests/test_path_alias.c tests/test_configlink.c tests/test_infrascan.c tests/test_worker_pool.c tests/test_parallel.c tests/test_index_resilience.c tests/test_index_format .c tests/test_call_reference_contract.c tests/repro/repro_call_scope_usages.c tests/repro/repro_call_argument_usages.c tests/repro/repro_reference_precision.c tests/repro/repro_lexical_binding_precision.c tests/repro/repro_call_argument_matrix_a.c tests/repro/repro_call_argument_matrix_b.c tests/repro/repro_call_node_behaviors.c tests/repro/repro_language_registry.c tests/repro/repro_call_node_manifest.c tests/repro/repro_lsp_ordered_signatures.c tests/repro/repro_lsp_ordered_local.c tests/repro/repro_ts_overload_return_chains.c tests/repro/repro_harness_cleanup.c tests/repro/repro_runner_filter.c
563590
564591TEST_WATCHER_SRCS = tests/test_watcher.c
565592
0 commit comments