When building a shared ELF library with FIPS, set the section markers hidden. This forces resolving of these marker symbols within the BCM to ignore other libraries, thereby making the hash computation correct even if multiple BoringSSL builds were to be linked together. Bug: 42220000 Change-Id: I02cd6941bb0b894492ae98d00c1727fa6a6a6964 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/89227 Commit-Queue: Rudolf Polzer <rpolzer@google.com> Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/crypto/fipsmodule/fips_shared.lds b/crypto/fipsmodule/fips_shared.lds index 1f20b96..4f9c0a1 100644 --- a/crypto/fipsmodule/fips_shared.lds +++ b/crypto/fipsmodule/fips_shared.lds
@@ -1,20 +1,20 @@ SECTIONS { .text : { - BORINGSSL_bcm_text_start = .; + PROVIDE_HIDDEN(BORINGSSL_bcm_text_start = .); *(.text) *(.text.unlikely.*) /* These sections shouldn't exist. But C++ `inline` symbols seem to be * placed in function sections on Android even with * -fno-function-sections. */ *(text.*) - BORINGSSL_bcm_text_end = .; + PROVIDE_HIDDEN(BORINGSSL_bcm_text_end = .); } .rodata : { - BORINGSSL_bcm_rodata_start = .; + PROVIDE_HIDDEN(BORINGSSL_bcm_rodata_start = .); *(.rodata) *(.rodata.*) - BORINGSSL_bcm_rodata_end = .; + PROVIDE_HIDDEN(BORINGSSL_bcm_rodata_end = .); } /DISCARD/ : {