[coreboot] New patch to review for coreboot: e1dc2eb bd82x6x: don't use absolute symbols

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Fri Mar 15 21:13:38 CET 2013


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2760

-gerrit

commit e1dc2eb6d240b2fd0b4a2739335de2e26db92253
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Fri Feb 8 16:14:07 2013 -0600

    bd82x6x: don't use absolute symbols
    
    objcopy -B provides symbols of the form _binary_<name>_(start|end|size).
    However, the _size variant is an absoult symbol.  If one wants to
    relocate the smi loading the _size symbol will be relocated which is
    wrong since it is suppose to be a fixed size. There is no way to
    distinguish symbols that shouldn't be relocated vs ones that can.
    Instead use the _start and _end variants to determine the size.
    
    Change-Id: I55192992cf36f62a9d8dd896e5fb3043a3eacbd3
    Signed-off-by: Aaron Durbin <adurbin at chromium.org>
---
 src/southbridge/intel/bd82x6x/smi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/southbridge/intel/bd82x6x/smi.c b/src/southbridge/intel/bd82x6x/smi.c
index c89ae18..f34a96e 100644
--- a/src/southbridge/intel/bd82x6x/smi.c
+++ b/src/southbridge/intel/bd82x6x/smi.c
@@ -35,7 +35,7 @@
 #endif
 
 extern unsigned char _binary_smm_start;
-extern unsigned char _binary_smm_size;
+extern unsigned char _binary_smm_end;
 
 /* While we read PMBASE dynamically in case it changed, let's
  * initialize it with a sane value
@@ -352,7 +352,8 @@ static void smm_install(void)
 
 	/* copy the real SMM handler */
 	printk(BIOS_DEBUG, "Installing SMM handler to 0x%08x\n", smm_base);
-	memcpy((void *)smm_base, &_binary_smm_start, (size_t)&_binary_smm_size);
+	memcpy((void *)smm_base, &_binary_smm_start,
+	       (size_t)(&_binary_smm_end - &_binary_smm_start));
 
 	/* copy the IED header into place */
 	if (CONFIG_SMM_TSEG_SIZE > IED_SIZE) {



More information about the coreboot mailing list