From ad8d5cb82ae7c7928a8f8ffcf59cc8713a163363 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Fri, 5 Jan 2018 10:26:02 -0800 Subject: cr50: fix annoying LD warnings The compiler marks data put into the TPM2_common.bss section as PROGBITS, which the linker does not like. Changing the section name prevents the marking and keeps linker happy. BRANCH=cr50 BUG=chromium:799385 TEST=verified that local_state is still in where it belongs: $ egrep '(local_state|__bss_libtpm2)' build/cr50/RW/ec.RW.smap 00010400 B __bss_libtpm2_start 00015d0c b local_state 00015d18 B __bss_libtpm2_end Change-Id: I48f7d2cb08c7ccb2ef3b3159eaf4d66e2b8720b4 Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/852793 Reviewed-by: Randall Spangler (cherry picked from commit 57bb4ddf4163dbe3da48ba56464adbabfa596344) Reviewed-on: https://chromium-review.googlesource.com/896753 --- board/cr50/tpm2/NVMem.c | 2 +- core/cortex-m/ec.lds.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/board/cr50/tpm2/NVMem.c b/board/cr50/tpm2/NVMem.c index 7921270fb2..33ce13a336 100644 --- a/board/cr50/tpm2/NVMem.c +++ b/board/cr50/tpm2/NVMem.c @@ -25,7 +25,7 @@ static struct { BOOL s_NvIsAvailable; BOOL s_NV_unrecoverable; BOOL s_NV_recoverable; -} local_state __attribute__((section("Tpm2_common.bss"))); +} local_state __attribute__((section(".bss.Tpm2_common"))); /* * This function is used by the simulator to set the error flags in the NV * subsystem to simulate an error in the NV loading process. diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index 5fbddcf269..639b17f7f7 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -251,7 +251,7 @@ SECTIONS Tpm2_*(.bss) /* TPM registers should be cleared at the same time */ STRINGIFY(OUTDIR/common/tpm_registers.o*)(.bss) - *(Tpm2_common.bss) + *(.bss.Tpm2_common) __bss_libtpm2_end = .; *(.bss) -- cgit v1.2.1