summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2014-09-08 12:08:21 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-09-22 13:30:25 -0500
commite7d14e42caf28c421dfaa4b3b15bda7cf5a77e43 (patch)
tree2fd4c36cce3ebe9f9411ff20d14fc6c723f80498 /src
parentc7187ce599df0f6ff1e516b94aa22312dc43e179 (diff)
downloadtalos-hostboot-e7d14e42caf28c421dfaa4b3b15bda7cf5a77e43.tar.gz
talos-hostboot-e7d14e42caf28c421dfaa4b3b15bda7cf5a77e43.zip
Fix memory leak detector on newer GCC.
Change-Id: Ifb42ce134d6cc27db23aa4787ad83c92070c1c95 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13249 Tested-by: Jenkins Server Reviewed-by: STEPHEN M. CPREK <smcprek@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/stdlib.C8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/stdlib.C b/src/lib/stdlib.C
index 2693848a6..610a045a3 100644
--- a/src/lib/stdlib.C
+++ b/src/lib/stdlib.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2010,2014 */
+/* Contributors Listed Below - COPYRIGHT 2010,2014 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -63,6 +65,10 @@ static void memoryleak_magic_instruction(MemoryLeak_FunctionType func,
void* ptr,
void* ptr2)
{
+ // Newer GCC seems to optimize out the parameter placement unless we
+ // fake them going into an assembly instruction.
+ asm volatile("" :: "r"(func), "r"(size), "r"(ptr), "r"(ptr2));
+
MAGIC_INSTRUCTION(MAGIC_MEMORYLEAK_FUNCTION);
return;
}
OpenPOWER on IntegriCloud