Include rodata subsections in FIPS-shared build.
Sometimes the linker will generate rodata subsections even if we don't
have -fdata-sections enabled. That's ok, so include them in the FIPS
module. The other subsections continue to be discarded to ensure that
unexpected sections don't appear and escape the module.
Bug: b/142971559
Change-Id: Icebcf40bd3d0e63f20456e44f6c2564f4316b561
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/43324
Commit-Queue: Adam Langley <alangley@gmail.com>
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/crypto/fipsmodule/fips_shared.lds b/crypto/fipsmodule/fips_shared.lds
index c3db101..323de73 100644
--- a/crypto/fipsmodule/fips_shared.lds
+++ b/crypto/fipsmodule/fips_shared.lds
@@ -8,18 +8,17 @@
.rodata : {
BORINGSSL_bcm_rodata_start = .;
*(.rodata)
+ *(.rodata.*)
BORINGSSL_bcm_rodata_end = .;
}
/DISCARD/ : {
+ /* These sections shouldn't exist. In order to catch any slip-ups, direct
+ * the linker to discard them. */
*(.rela.dyn)
*(.data)
*(.rel.ro)
*(*.text.*)
*(*.data.*)
-
- /* This should be included to catch any unexpected rodata subsections, but
- it crashes the linker!
- *(*.rodata.*) */
}
}