Add an autoconf test to test whether the .section .gnu<warning>

works with the linker on the system, and define _warn_references
to nothing if not.
This commit is contained in:
Lin Xu
2012-09-09 17:33:35 -07:00
parent 4b1a0668a8
commit e7e0600405
3 changed files with 25 additions and 8 deletions

View File

@@ -7,11 +7,10 @@
#ifndef __warn_references
#ifdef __GNUC__
#define __warn_references(sym,msg) \
__asm(".pushsection .gnu.warning." #sym "\n" \
".ascii \"" msg "\"\n" \
".popsection");
#if defined(__GNUC__) && defined (HAS_GNU_WARNING_LONG)
#define __warn_references(sym,msg) \
__asm__(".section .gnu" #sym ",\n\t.ascii \"" msg "\"\n\t.text");
#else
#define __warn_references(sym,msg) /* nothing */