summaryrefslogtreecommitdiff
path: root/schulung_tools/mtrace/mtrace.patch
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2017-12-19 10:59:40 +0100
committerJohn Ogness <john.ogness@linutronix.de>2017-12-19 10:59:40 +0100
commit270520b4a2eac8725c8575c3180964289722e191 (patch)
treed9512cd96d0c52e14293c3f8bc19fd168ee14025 /schulung_tools/mtrace/mtrace.patch
parent27209bb802048f4803d9cd9a5c2f99d613986446 (diff)
schulung_tools: add various demos and tools
Different tools have been used by various trainers as demos. Put all these into master so they are available to all trainers. ipc_pipe: ipc demo using pipes ipc_shm: ipc demo using shared memory libduma: source and instructions for compiling libduma matrix: demo of good and bad cache access mtrace: patch and infos for using mtrace with ASLR rtex: demo of handling page faults Signed-off-by: John Ogness <john.ogness@linutronix.de>
Diffstat (limited to 'schulung_tools/mtrace/mtrace.patch')
-rw-r--r--schulung_tools/mtrace/mtrace.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/schulung_tools/mtrace/mtrace.patch b/schulung_tools/mtrace/mtrace.patch
new file mode 100644
index 0000000..874388c
--- /dev/null
+++ b/schulung_tools/mtrace/mtrace.patch
@@ -0,0 +1,25 @@
+Patch mtrace to deal with new ASLR issues.
+--- a/mtrace 2017-06-15 20:17:14.000000000 +0100
++++ b/mtrace 2017-12-13 12:09:31.584089486 +0000
+@@ -75,10 +75,10 @@ if ($#ARGV == 0) {
+ } else {
+ $prog = "./$binary";
+ }
+- if (open (LOCS, "env LD_TRACE_LOADED_OBJECTS=1 $prog |")) {
++ if (open (LOCS, "env LD_TRACE_PRELINKING=1 $prog |")) {
+ while (<LOCS>) {
+ chop;
+- if (/^.*=> (.*) .(0x[0123456789abcdef]*).$/) {
++ if (/^.*=> (.*) .(0x[0123456789abcdef]*),.*/) {
+ $locs{$1} = $2;
+ }
+ }
+@@ -111,7 +111,7 @@ sub location {
+ my $searchaddr;
+ return $cache{$addr} if (exists $cache{$addr});
+ if ($locs{$prog} ne "") {
+- $searchaddr = sprintf "%#x", $addr - $locs{$prog};
++ $searchaddr = sprintf "%#x", hex($addr) - hex($locs{$prog});
+ } else {
+ $searchaddr = $addr;
+ $prog = $binary;