summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-07-10 13:53:00 +0200
committerMark Wielaard <mjw@redhat.com>2009-07-10 13:53:00 +0200
commit880fc23fa180ae9c9557e7ff945f5f1e750aef15 (patch)
treed2867d966e8295ed8abf9d5f2de799f2c0fed0fa
parent2203b03262e340b25fc26996cc2786c1c02041e3 (diff)
downloadsystemtap-steved-880fc23fa180ae9c9557e7ff945f5f1e750aef15.tar.gz
systemtap-steved-880fc23fa180ae9c9557e7ff945f5f1e750aef15.tar.xz
systemtap-steved-880fc23fa180ae9c9557e7ff945f5f1e750aef15.zip
PR10381 sdt.h macros create relocatable addresses in non-writable section.
Allocated section needs to be writable when creating pic shared objects because we store relocatable addresses in them. * includes/sys/sdt.h (ALLOCSEC): New macro, depends on __PIC__. (STAP_PROBE_DATA_): Use new ALLOCSEC macro.
-rw-r--r--includes/sys/sdt.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h
index e448c90e..3b788b88 100644
--- a/includes/sys/sdt.h
+++ b/includes/sys/sdt.h
@@ -17,9 +17,17 @@
#define STAP_PROBE_ADDR "\t.long "
#endif
+/* Allocated section needs to be writable when creating pic shared objects
+ because we store relocatable addresses in them. */
+#ifdef __PIC__
+#define ALLOCSEC "\"aw\""
+#else
+#define ALLOCSEC "\"a\""
+#endif
+
/* An allocated section .probes that holds the probe names and addrs. */
#define STAP_PROBE_DATA_(probe,guard,arg) \
- __asm__ volatile (".section .probes, \"a\"\n" \
+ __asm__ volatile (".section .probes," ALLOCSEC "\n" \
"\t.align 8\n" \
"1:\n\t.asciz " #probe "\n" \
"\t.align 4\n" \