ANDROID: fips140: split dump-section+add-section into 2 ops

It looks like llvm-objcopy regressed the ability to simultaneously dump
then re-add a section with a new name.  Prefer 2 invocations of
$(OBJCOPY); dump-sections in the first, add-section and
set-section-flags in the second. This copies the sections rather than
rename them.

Test: BUILD_CONFIG=common-modules/virtual-device/build.config.virtual_device.i686 build/build.sh
Bug: 247603894
Link: https://reviews.llvm.org/D120486
Suggested-by: Eric Biggers <ebiggers@google.com>
Suggested-by: Fangrui Song <maskray@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: I7f102f05b048b6c5f7aaeb0e438af84c2d2b4d1a
This commit is contained in:
Nick Desaulniers
2022-09-26 15:49:56 -07:00
parent 38bfd3357f
commit 84572a0c79

View File

@@ -20,7 +20,8 @@ CMD_FIPS140_GEN_HMAC = crypto/fips140_gen_hmac
quiet_cmd_gen_hmac = HMAC $@
cmd_gen_hmac = $(OBJCOPY) $@ \
--dump-section=$(shell $(READELF) -SW $@|grep -Eo '\.rela\.text\S*')=$@.rela.text \
--dump-section=$(shell $(READELF) -SW $@|grep -Eo '\.rela\.rodata\S*')=$@.rela.rodata \
--dump-section=$(shell $(READELF) -SW $@|grep -Eo '\.rela\.rodata\S*')=$@.rela.rodata && \
$(OBJCOPY) $@ \
--add-section=.init.rela.text=$@.rela.text \
--add-section=.init.rela.rodata=$@.rela.rodata \
--set-section-flags=.init.rela.text=alloc,readonly \