summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrutz Behn2015-06-02 21:33:39 +0200
committersin2015-06-03 08:33:32 +0100
commita9ee1d2743acb0b2903db87c0a241c0a569cfc4e (patch)
tree2568b19dcd1424737c7029e2b5f1e64844fba573
parentec970ecb88df2bdaa200990ed1ca1e3194471c84 (diff)
Fix usage of __USER_LABEL_PREFIX__
The predefined __USER_LABEL_PREFIX__ macro if it is non-empty contains an identifier, not a string literal, thus it needs to be stringified.
-rw-r--r--include/fortify-headers.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/fortify-headers.h b/include/fortify-headers.h
index 72b99ec..fcb862d 100644
--- a/include/fortify-headers.h
+++ b/include/fortify-headers.h
@@ -16,7 +16,9 @@
16#ifndef _FORTIFY_HEADERS_H 16#ifndef _FORTIFY_HEADERS_H
17#define _FORTIFY_HEADERS_H 17#define _FORTIFY_HEADERS_H
18 18
19#define fortify_fn(fn) __typeof__(fn) __orig_##fn __asm__(__USER_LABEL_PREFIX__ #fn); \ 19#define _FORTIFY_STR(s) #s
20#define _FORTIFY_ORIG(p,fn) __typeof__(fn) __orig_##fn __asm__(_FORTIFY_STR(p) #fn)
21#define fortify_fn(fn) _FORTIFY_ORIG(__USER_LABEL_PREFIX__,fn); \
20 extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) 22 extern __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
21 23
22#endif 24#endif