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>
chromium-5359
Adam Langley 4 years ago committed by CQ bot account: commit-bot@chromium.org
parent 991835dfa9
commit 51b428153d
  1. 7
      crypto/fipsmodule/fips_shared.lds

@ -8,18 +8,17 @@ SECTIONS
.rodata : { .rodata : {
BORINGSSL_bcm_rodata_start = .; BORINGSSL_bcm_rodata_start = .;
*(.rodata) *(.rodata)
*(.rodata.*)
BORINGSSL_bcm_rodata_end = .; BORINGSSL_bcm_rodata_end = .;
} }
/DISCARD/ : { /DISCARD/ : {
/* These sections shouldn't exist. In order to catch any slip-ups, direct
* the linker to discard them. */
*(.rela.dyn) *(.rela.dyn)
*(.data) *(.data)
*(.rel.ro) *(.rel.ro)
*(*.text.*) *(*.text.*)
*(*.data.*) *(*.data.*)
/* This should be included to catch any unexpected rodata subsections, but
it crashes the linker!
*(*.rodata.*) */
} }
} }

Loading…
Cancel
Save