Version: 0.3.36
* Fixed "--indent" option
* Got rid of Debian and RedHat specific parts in tarball
diff --git a/sysdeps/linux-gnu/Makefile b/sysdeps/linux-gnu/Makefile
index cdea9af..7163709 100644
--- a/sysdeps/linux-gnu/Makefile
+++ b/sysdeps/linux-gnu/Makefile
@@ -1,8 +1,8 @@
-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
-CFLAGS += -I$(TOPDIR)/sysdeps/linux-gnu/$(ARCH)
+CPPFLAGS += -I$(TOPDIR)/sysdeps/linux-gnu/$(ARCH)
-OBJ = trace.o proc.o breakpoint.o
+OBJ = trace.o proc.o breakpoint.o
all: sysdep.h signalent.h syscallent.h ../sysdep.o
@@ -16,10 +16,10 @@
cp $(ARCH)/syscallent.h syscallent.h
../sysdep.o: os.o $(ARCH)/arch.o
- $(LD) -r -o ../sysdep.o os.o $(ARCH)/arch.o
+ $(CC) -nostdlib -r -o ../sysdep.o os.o $(ARCH)/arch.o
os.o: $(OBJ)
- $(LD) -r -o os.o $(OBJ)
+ $(CC) -nostdlib -r -o os.o $(OBJ)
$(ARCH)/arch.o: dummy
$(MAKE) -C $(ARCH)
diff --git a/sysdeps/linux-gnu/alpha/Makefile b/sysdeps/linux-gnu/alpha/Makefile
index 4b347a5..60d7531 100644
--- a/sysdeps/linux-gnu/alpha/Makefile
+++ b/sysdeps/linux-gnu/alpha/Makefile
@@ -1,9 +1,9 @@
-OBJ = trace.o regs.o
+OBJ = trace.o regs.o plt.o
all: arch.o
arch.o: $(OBJ)
- $(LD) -r -o arch.o $(OBJ)
+ $(CC) -nostdlib -r -o arch.o $(OBJ)
clean:
$(RM) $(OBJ) arch.o
diff --git a/sysdeps/linux-gnu/alpha/arch.h b/sysdeps/linux-gnu/alpha/arch.h
index ce484aa..cdeeb52 100644
--- a/sysdeps/linux-gnu/alpha/arch.h
+++ b/sysdeps/linux-gnu/alpha/arch.h
@@ -1,4 +1,7 @@
#define BREAKPOINT_VALUE { 0x80, 0x00, 0x00, 0x00 }
#define BREAKPOINT_LENGTH 4
#define DECR_PC_AFTER_BREAK 4
-#define ELFSIZE 64
+
+#define LT_ELFCLASS ELFCLASS64
+#define LT_ELF_MACHINE EM_ALPHA
+#define LT_ELF_MACHINE2 EM_FAKE_ALPHA
diff --git a/sysdeps/linux-gnu/alpha/plt.c b/sysdeps/linux-gnu/alpha/plt.c
new file mode 100644
index 0000000..a626d59
--- /dev/null
+++ b/sysdeps/linux-gnu/alpha/plt.c
@@ -0,0 +1,9 @@
+#include <gelf.h>
+#include "ltrace.h"
+#include "elf.h"
+
+GElf_Addr
+arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+{
+ return lte->plt_addr + ndx * 12 + 32;
+}
diff --git a/sysdeps/linux-gnu/alpha/syscallent.h b/sysdeps/linux-gnu/alpha/syscallent.h
index ec0605b..97256d2 100644
--- a/sysdeps/linux-gnu/alpha/syscallent.h
+++ b/sysdeps/linux-gnu/alpha/syscallent.h
@@ -421,4 +421,19 @@
"clock_gettime", /* 420 */
"clock_getres", /* 421 */
"clock_nanosleep", /* 422 */
- "semtimedop" /* 423 */
+ "semtimedop", /* 423 */
+ "tgkill", /* 424 */
+ "stat64", /* 425 */
+ "lstat64", /* 426 */
+ "fstat64", /* 427 */
+ "vserver", /* 428 */
+ "mbind", /* 429 */
+ "get_mempolicy", /* 430 */
+ "set_mempolicy", /* 431 */
+ "mq_open", /* 432 */
+ "mq_unlink", /* 433 */
+ "mq_timedsend", /* 434 */
+ "mq_timedreceive", /* 435 */
+ "mq_notify", /* 436 */
+ "mq_getsetattr", /* 437 */
+ "waitid" /* 438 */
diff --git a/sysdeps/linux-gnu/arm/Makefile b/sysdeps/linux-gnu/arm/Makefile
index 7886d8d..00e77bc 100644
--- a/sysdeps/linux-gnu/arm/Makefile
+++ b/sysdeps/linux-gnu/arm/Makefile
@@ -1,9 +1,9 @@
-OBJ = trace.o regs.o
+OBJ = trace.o regs.o plt.o
all: arch.o
arch.o: $(OBJ) arch.h
- $(LD) -r -o arch.o $(OBJ)
+ $(CC) -nostdlib -r -o arch.o $(OBJ)
clean:
$(RM) $(OBJ) arch.o
diff --git a/sysdeps/linux-gnu/arm/arch.h b/sysdeps/linux-gnu/arm/arch.h
index dc2a1d0..e8a8b66 100644
--- a/sysdeps/linux-gnu/arm/arch.h
+++ b/sysdeps/linux-gnu/arm/arch.h
@@ -1,3 +1,6 @@
#define BREAKPOINT_VALUE { 0x01, 0x00, 0x9f, 0xef }
#define BREAKPOINT_LENGTH 4
#define DECR_PC_AFTER_BREAK 0
+
+#define LT_ELFCLASS ELFCLASS32
+#define LT_ELF_MACHINE EM_ARM
diff --git a/sysdeps/linux-gnu/arm/plt.c b/sysdeps/linux-gnu/arm/plt.c
new file mode 100644
index 0000000..635b4ce
--- /dev/null
+++ b/sysdeps/linux-gnu/arm/plt.c
@@ -0,0 +1,9 @@
+#include <gelf.h>
+#include "ltrace.h"
+#include "elf.h"
+
+GElf_Addr
+arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+{
+ return lte->plt_addr + 20 + ndx * 12;
+}
diff --git a/sysdeps/linux-gnu/i386/Makefile b/sysdeps/linux-gnu/i386/Makefile
index 4b347a5..60d7531 100644
--- a/sysdeps/linux-gnu/i386/Makefile
+++ b/sysdeps/linux-gnu/i386/Makefile
@@ -1,9 +1,9 @@
-OBJ = trace.o regs.o
+OBJ = trace.o regs.o plt.o
all: arch.o
arch.o: $(OBJ)
- $(LD) -r -o arch.o $(OBJ)
+ $(CC) -nostdlib -r -o arch.o $(OBJ)
clean:
$(RM) $(OBJ) arch.o
diff --git a/sysdeps/linux-gnu/i386/arch.h b/sysdeps/linux-gnu/i386/arch.h
index 6a18fd7..dc7383f 100644
--- a/sysdeps/linux-gnu/i386/arch.h
+++ b/sysdeps/linux-gnu/i386/arch.h
@@ -1,3 +1,6 @@
#define BREAKPOINT_VALUE {0xcc}
#define BREAKPOINT_LENGTH 1
#define DECR_PC_AFTER_BREAK 1
+
+#define LT_ELFCLASS ELFCLASS32
+#define LT_ELF_MACHINE EM_386
diff --git a/sysdeps/linux-gnu/i386/plt.c b/sysdeps/linux-gnu/i386/plt.c
new file mode 100644
index 0000000..e40b03a
--- /dev/null
+++ b/sysdeps/linux-gnu/i386/plt.c
@@ -0,0 +1,9 @@
+#include <gelf.h>
+#include "ltrace.h"
+#include "elf.h"
+
+GElf_Addr
+arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+{
+ return lte->plt_addr + (ndx + 1) * 16;
+}
diff --git a/sysdeps/linux-gnu/i386/syscallent.h b/sysdeps/linux-gnu/i386/syscallent.h
index 0a6d9cc..b6eb2a8 100644
--- a/sysdeps/linux-gnu/i386/syscallent.h
+++ b/sysdeps/linux-gnu/i386/syscallent.h
@@ -1,4 +1,4 @@
- "0", /* 0 */
+ "restart_syscall", /* 0 */
"exit", /* 1 */
"fork", /* 2 */
"read", /* 3 */
@@ -178,8 +178,8 @@
"rt_sigtimedwait", /* 177 */
"rt_sigqueueinfo", /* 178 */
"rt_sigsuspend", /* 179 */
- "pread", /* 180 */
- "pwrite", /* 181 */
+ "pread64", /* 180 */
+ "pwrite64", /* 181 */
"chown", /* 182 */
"getcwd", /* 183 */
"capget", /* 184 */
@@ -221,7 +221,7 @@
"getdents64", /* 220 */
"fcntl64", /* 221 */
"222", /* 222 */
- "security", /* 223 */
+ "223", /* 223 */
"gettid", /* 224 */
"readahead", /* 225 */
"setxattr", /* 226 */
@@ -248,6 +248,38 @@
"io_getevents", /* 247 */
"io_submit", /* 248 */
"io_cancel", /* 249 */
- "alloc_hugepages", /* 250 */
- "free_hugepages", /* 251 */
+ "fadvise64", /* 250 */
+ "251", /* 251 */
"exit_group", /* 252 */
+ "lookup_dcookie", /* 253 */
+ "epoll_create", /* 254 */
+ "epoll_ctl", /* 255 */
+ "epoll_wait", /* 256 */
+ "remap_file_pages", /* 257 */
+ "set_tid_address", /* 258 */
+ "timer_create", /* 259 */
+ "timer_settime", /* 260 */
+ "timer_gettime", /* 261 */
+ "timer_getoverrun", /* 262 */
+ "timer_delete", /* 263 */
+ "clock_settime", /* 264 */
+ "clock_gettime", /* 265 */
+ "clock_getres", /* 266 */
+ "clock_nanosleep", /* 267 */
+ "statfs64", /* 268 */
+ "fstatfs64", /* 269 */
+ "tgkill", /* 270 */
+ "utimes", /* 271 */
+ "fadvise64_64", /* 272 */
+ "vserver", /* 273 */
+ "mbind", /* 274 */
+ "get_mempolicy", /* 275 */
+ "set_mempolicy", /* 276 */
+ "mq_open", /* 277 */
+ "mq_unlink", /* 278 */
+ "mq_timedsend", /* 279 */
+ "mq_timedreceive", /* 280 */
+ "mq_notify", /* 281 */
+ "mq_getsetattr", /* 282 */
+ "kexec_load", /* 283 */
+ "waitid", /* 284 */
diff --git a/sysdeps/linux-gnu/m68k/Makefile b/sysdeps/linux-gnu/m68k/Makefile
index 4b347a5..60d7531 100644
--- a/sysdeps/linux-gnu/m68k/Makefile
+++ b/sysdeps/linux-gnu/m68k/Makefile
@@ -1,9 +1,9 @@
-OBJ = trace.o regs.o
+OBJ = trace.o regs.o plt.o
all: arch.o
arch.o: $(OBJ)
- $(LD) -r -o arch.o $(OBJ)
+ $(CC) -nostdlib -r -o arch.o $(OBJ)
clean:
$(RM) $(OBJ) arch.o
diff --git a/sysdeps/linux-gnu/m68k/arch.h b/sysdeps/linux-gnu/m68k/arch.h
index a29e5f1..1790d09 100644
--- a/sysdeps/linux-gnu/m68k/arch.h
+++ b/sysdeps/linux-gnu/m68k/arch.h
@@ -1,3 +1,6 @@
#define BREAKPOINT_VALUE { 0x4e, 0x4f }
#define BREAKPOINT_LENGTH 2
#define DECR_PC_AFTER_BREAK 2
+
+#define LT_ELFCLASS ELFCLASS32
+#define LT_ELF_MACHINE EM_68K
diff --git a/sysdeps/linux-gnu/m68k/plt.c b/sysdeps/linux-gnu/m68k/plt.c
new file mode 100644
index 0000000..f20986c
--- /dev/null
+++ b/sysdeps/linux-gnu/m68k/plt.c
@@ -0,0 +1,10 @@
+#include <gelf.h>
+#include "ltrace.h"
+#include "elf.h"
+
+GElf_Addr
+arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+{
+ return lte->plt_addr + (ndx + 1)
+ * ((lte->ehdr.e_flags & EF_CPU32) ? 24 : 12);
+}
diff --git a/sysdeps/linux-gnu/ppc/Makefile b/sysdeps/linux-gnu/ppc/Makefile
index 4b347a5..60d7531 100644
--- a/sysdeps/linux-gnu/ppc/Makefile
+++ b/sysdeps/linux-gnu/ppc/Makefile
@@ -1,9 +1,9 @@
-OBJ = trace.o regs.o
+OBJ = trace.o regs.o plt.o
all: arch.o
arch.o: $(OBJ)
- $(LD) -r -o arch.o $(OBJ)
+ $(CC) -nostdlib -r -o arch.o $(OBJ)
clean:
$(RM) $(OBJ) arch.o
diff --git a/sysdeps/linux-gnu/ppc/arch.h b/sysdeps/linux-gnu/ppc/arch.h
index 72fa45f..e04e885 100644
--- a/sysdeps/linux-gnu/ppc/arch.h
+++ b/sysdeps/linux-gnu/ppc/arch.h
@@ -1,3 +1,6 @@
#define BREAKPOINT_VALUE { 0x7f, 0xe0, 0x00, 0x08 }
#define BREAKPOINT_LENGTH 4
#define DECR_PC_AFTER_BREAK 0
+
+#define LT_ELFCLASS ELFCLASS32
+#define LT_ELF_MACHINE EM_PPC
diff --git a/sysdeps/linux-gnu/ppc/plt.c b/sysdeps/linux-gnu/ppc/plt.c
new file mode 100644
index 0000000..9e2c094
--- /dev/null
+++ b/sysdeps/linux-gnu/ppc/plt.c
@@ -0,0 +1,9 @@
+#include <gelf.h>
+#include "ltrace.h"
+#include "elf.h"
+
+GElf_Addr
+arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+{
+ return rela->r_offset;
+}
diff --git a/sysdeps/linux-gnu/ppc/syscallent.h b/sysdeps/linux-gnu/ppc/syscallent.h
index e709aab..2bbba38 100644
--- a/sysdeps/linux-gnu/ppc/syscallent.h
+++ b/sysdeps/linux-gnu/ppc/syscallent.h
@@ -222,7 +222,7 @@
"futex", /* 221 */
"sched_setaffinity", /* 222 */
"sched_getaffinity", /* 223 */
- "security", /* 224 */
+ "224", /* 224 */
"tuxcall", /* 225 */
"sendfile64", /* 226 */
"io_setup", /* 227 */
@@ -230,3 +230,34 @@
"io_getevents", /* 229 */
"io_submit", /* 230 */
"io_cancel", /* 231 */
+ "set_tid_address", /* 232 */
+ "fadvise64", /* 233 */
+ "exit_group", /* 234 */
+ "lookup_dcookie", /* 235 */
+ "epoll_create", /* 236 */
+ "epoll_ctl", /* 237 */
+ "epoll_wait", /* 238 */
+ "remap_file_pages", /* 239 */
+ "timer_create", /* 240 */
+ "timer_settime", /* 241 */
+ "timer_gettime", /* 242 */
+ "timer_getoverrun", /* 243 */
+ "timer_delete", /* 244 */
+ "clock_settime", /* 245 */
+ "clock_gettime", /* 246 */
+ "clock_getres", /* 247 */
+ "clock_nanosleep", /* 248 */
+ "swapcontext", /* 249 */
+ "tgkill", /* 250 */
+ "utimes", /* 251 */
+ "statfs64", /* 252 */
+ "fstatfs64", /* 253 */
+ "fadvise64_64", /* 254 */
+ "rtas", /* 255 */
+ "mq_open", /* 262 */
+ "mq_unlink", /* 263 */
+ "mq_timedsend", /* 264 */
+ "mq_timedreceive", /* 265 */
+ "mq_notify", /* 266 */
+ "mq_getsetattr", /* 267 */
+ "kexec_load", /* 268 */
diff --git a/sysdeps/linux-gnu/s390/Makefile b/sysdeps/linux-gnu/s390/Makefile
index ffad176..cea1b45 100644
--- a/sysdeps/linux-gnu/s390/Makefile
+++ b/sysdeps/linux-gnu/s390/Makefile
@@ -2,12 +2,12 @@
# S/390 version
# Copyright (C) 2001 IBM Poughkeepsie, IBM Corporation
#
-OBJ = trace.o regs.o
+OBJ = trace.o regs.o plt.o
all: arch.o
arch.o: $(OBJ)
- $(LD) -r -o arch.o $(OBJ)
+ $(CC) -nostdlib -r -o arch.o $(OBJ)
clean:
$(RM) $(OBJ) arch.o
diff --git a/sysdeps/linux-gnu/s390/arch.h b/sysdeps/linux-gnu/s390/arch.h
index fc66afb..bb61ca7 100644
--- a/sysdeps/linux-gnu/s390/arch.h
+++ b/sysdeps/linux-gnu/s390/arch.h
@@ -6,3 +6,6 @@
#define BREAKPOINT_VALUE { 0x00, 0x01 }
#define BREAKPOINT_LENGTH 2
#define DECR_PC_AFTER_BREAK 2
+
+#define LT_ELFCLASS ELFCLASS32
+#define LT_ELF_MACHINE EM_S390
diff --git a/sysdeps/linux-gnu/s390/plt.c b/sysdeps/linux-gnu/s390/plt.c
new file mode 100644
index 0000000..df31b48
--- /dev/null
+++ b/sysdeps/linux-gnu/s390/plt.c
@@ -0,0 +1,9 @@
+#include <gelf.h>
+#include "ltrace.h"
+#include "elf.h"
+
+GElf_Addr
+arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+{
+ return lte->plt_addr + (ndx + 1) * 32;
+}
diff --git a/sysdeps/linux-gnu/s390/syscallent.h b/sysdeps/linux-gnu/s390/syscallent.h
index 6ee7829..13bd3c2 100644
--- a/sysdeps/linux-gnu/s390/syscallent.h
+++ b/sysdeps/linux-gnu/s390/syscallent.h
@@ -221,7 +221,7 @@
"getdents64", /* 220 */
"fcntl64", /* 221 */
"readahead", /* 222 */
- "223", /* 223 */
+ "sendfile64", /* 223 */
"setxattr", /* 224 */
"lsetxattr", /* 225 */
"fsetxattr", /* 226 */
@@ -236,3 +236,42 @@
"fremovexattr", /* 235 */
"gettid", /* 236 */
"tkill", /* 237 */
+ "futex", /* 238 */
+ "sched_setaffinity", /* 239 */
+ "sched_getaffinity", /* 240 */
+ "241", /* 241 */
+ "242", /* 242 */
+ "io_setup", /* 243 */
+ "io_destroy", /* 244 */
+ "io_getevents", /* 245 */
+ "io_submit", /* 246 */
+ "io_cancel", /* 247 */
+ "exit_group", /* 248 */
+ "epoll_create", /* 249 */
+ "epoll_ctl", /* 250 */
+ "epoll_wait", /* 251 */
+ "set_tid_address", /* 252 */
+ "fadvise64", /* 253 */
+ "timer_create", /* 254 */
+ "timer_settime", /* 255 */
+ "timer_gettime", /* 256 */
+ "timer_getoverrun", /* 257 */
+ "timer_delete", /* 258 */
+ "clock_settime", /* 259 */
+ "clock_gettime", /* 260 */
+ "clock_getres", /* 261 */
+ "clock_nanosleep", /* 262 */
+ "263", /* 263 */
+ "fadvise64_64", /* 264 */
+ "statfs64", /* 265 */
+ "fstatfs64", /* 266 */
+ "267", /* 267 */
+ "268", /* 268 */
+ "269", /* 269 */
+ "270", /* 270 */
+ "mq_open", /* 271 */
+ "mq_unlink", /* 272 */
+ "mq_timedsend", /* 273 */
+ "mq_timedreceive", /* 274 */
+ "mq_notify", /* 275 */
+ "mq_getsetattr", /* 276 */
diff --git a/sysdeps/linux-gnu/sparc/Makefile b/sysdeps/linux-gnu/sparc/Makefile
index 6248ca8..b3914e5 100644
--- a/sysdeps/linux-gnu/sparc/Makefile
+++ b/sysdeps/linux-gnu/sparc/Makefile
@@ -1,9 +1,9 @@
-OBJ = regs.o trace.o
+OBJ = regs.o trace.o plt.o
all: arch.o
arch.o: $(OBJ)
- $(LD) -r -o arch.o $(OBJ)
+ $(CC) -nostdlib -r -o arch.o $(OBJ)
clean:
$(RM) $(OBJ) arch.o
diff --git a/sysdeps/linux-gnu/sparc/arch.h b/sysdeps/linux-gnu/sparc/arch.h
index 1173591..d2f85d2 100644
--- a/sysdeps/linux-gnu/sparc/arch.h
+++ b/sysdeps/linux-gnu/sparc/arch.h
@@ -2,3 +2,6 @@
#define BREAKPOINT_LENGTH 4
#define DECR_PC_AFTER_BREAK 0
+#define LT_ELFCLASS ELFCLASS32
+#define LT_ELF_MACHINE EM_SPARC
+#define LT_ELF_MACHINE2 EM_SPARC32PLUS
diff --git a/sysdeps/linux-gnu/sparc/plt.c b/sysdeps/linux-gnu/sparc/plt.c
new file mode 100644
index 0000000..52b2208
--- /dev/null
+++ b/sysdeps/linux-gnu/sparc/plt.c
@@ -0,0 +1,9 @@
+#include <gelf.h>
+#include "ltrace.h"
+#include "elf.h"
+
+GElf_Addr
+arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+{
+ return rela->r_offset + 4;
+}
diff --git a/sysdeps/linux-gnu/sparc/syscallent.h b/sysdeps/linux-gnu/sparc/syscallent.h
index cb2db16..c7ddc4f 100644
--- a/sysdeps/linux-gnu/sparc/syscallent.h
+++ b/sysdeps/linux-gnu/sparc/syscallent.h
@@ -1,256 +1,280 @@
- "0", /* 0 */
- "exit", /* 1 */
- "fork", /* 2 */
- "read", /* 3 */
- "write", /* 4 */
- "open", /* 5 */
- "close", /* 6 */
- "wait4", /* 7 */
- "creat", /* 8 */
- "link", /* 9 */
- "unlink", /* 10 */
- "execv", /* 11 */
- "chdir", /* 12 */
- "chown", /* 13 */
- "mknod", /* 14 */
- "chmod", /* 15 */
- "lchown", /* 16 */
- "brk", /* 17 */
- "perfctr", /* 18 */
- "lseek", /* 19 */
- "getpid", /* 20 */
- "capget", /* 21 */
- "capset", /* 22 */
- "setuid", /* 23 */
- "getuid", /* 24 */
- "25", /* 25 */
- "ptrace", /* 26 */
- "alarm", /* 27 */
- "sigaltstack", /* 28 */
- "pause", /* 29 */
- "utime", /* 30 */
- "31", /* 31 */
- "32", /* 32 */
- "access", /* 33 */
- "nice", /* 34 */
- "35", /* 35 */
- "sync", /* 36 */
- "kill", /* 37 */
- "stat", /* 38 */
- "sendfile", /* 39 */
- "lstat", /* 40 */
- "dup", /* 41 */
- "pipe", /* 42 */
- "times", /* 43 */
- "44", /* 44 */
- "umount2", /* 45 */
- "setgid", /* 46 */
- "getgid", /* 47 */
- "signal", /* 48 */
- "geteuid", /* 49 */
- "getegid", /* 50 */
- "acct", /* 51 */
- "memory_ordering", /* 52 */
- "53", /* 53 */
- "ioctl", /* 54 */
- "reboot", /* 55 */
- "56", /* 56 */
- "symlink", /* 57 */
- "readlink", /* 58 */
- "execve", /* 59 */
- "umask", /* 60 */
- "chroot", /* 61 */
- "fstat", /* 62 */
- "63", /* 63 */
- "getpagesize", /* 64 */
- "msync", /* 65 */
- "vfork", /* 66 */
- "pread", /* 67 */
- "pwrite", /* 68 */
- "69", /* 69 */
- "70", /* 70 */
- "mmap", /* 71 */
- "72", /* 72 */
- "munmap", /* 73 */
- "mprotect", /* 74 */
- "75", /* 75 */
- "vhangup", /* 76 */
- "77", /* 77 */
- "78", /* 78 */
- "getgroups", /* 79 */
- "setgroups", /* 80 */
- "getpgrp", /* 81 */
- "82", /* 82 */
- "setitimer", /* 83 */
- "84", /* 84 */
- "swapon", /* 85 */
- "getitimer", /* 86 */
- "87", /* 87 */
- "sethostname", /* 88 */
- "89", /* 89 */
- "dup2", /* 90 */
- "91", /* 91 */
- "fcntl", /* 92 */
- "select", /* 93 */
- "94", /* 94 */
- "fsync", /* 95 */
- "setpriority", /* 96 */
- "socket", /* 97 */
- "connect", /* 98 */
- "accept", /* 99 */
- "getpriority", /* 100 */
- "rt_sigreturn", /* 101 */
- "rt_sigaction", /* 102 */
- "rt_sigprocmask", /* 103 */
- "rt_sigpending", /* 104 */
- "rt_sigtimedwait", /* 105 */
- "rt_sigqueueinfo", /* 106 */
- "rt_sigsuspend", /* 107 */
- "108", /* 108 */
- "109", /* 109 */
- "110", /* 110 */
- "111", /* 111 */
- "112", /* 112 */
- "recvmsg", /* 113 */
- "sendmsg", /* 114 */
- "115", /* 115 */
- "gettimeofday", /* 116 */
- "getrusage", /* 117 */
- "getsockopt", /* 118 */
- "getcwd", /* 119 */
- "readv", /* 120 */
- "writev", /* 121 */
- "settimeofday", /* 122 */
- "fchown", /* 123 */
- "fchmod", /* 124 */
- "recvfrom", /* 125 */
- "setreuid", /* 126 */
- "setregid", /* 127 */
- "rename", /* 128 */
- "truncate", /* 129 */
- "ftruncate", /* 130 */
- "flock", /* 131 */
- "132", /* 132 */
- "sendto", /* 133 */
- "shutdown", /* 134 */
- "socketpair", /* 135 */
- "mkdir", /* 136 */
- "rmdir", /* 137 */
- "utimes", /* 138 */
- "139", /* 139 */
- "140", /* 140 */
- "getpeername", /* 141 */
- "142", /* 142 */
- "143", /* 143 */
- "getrlimit", /* 144 */
- "setrlimit", /* 145 */
- "146", /* 146 */
- "prctl", /* 147 */
- "pciconfig_read", /* 148 */
- "pciconfig_write", /* 149 */
- "getsockname", /* 150 */
- "151", /* 151 */
- "152", /* 152 */
- "poll", /* 153 */
- "154", /* 154 */
- "155", /* 155 */
- "156", /* 156 */
- "statfs", /* 157 */
- "fstatfs", /* 158 */
- "umount", /* 159 */
- "160", /* 160 */
- "161", /* 161 */
- "getdomainname", /* 162 */
- "setdomainname", /* 163 */
- "utrap_install", /* 164 */
- "quotactl", /* 165 */
- "166", /* 166 */
- "mount", /* 167 */
- "ustat", /* 168 */
- "169", /* 169 */
- "170", /* 170 */
- "171", /* 171 */
- "172", /* 172 */
- "173", /* 173 */
- "getdents", /* 174 */
- "setsid", /* 175 */
- "fchdir", /* 176 */
- "177", /* 177 */
- "178", /* 178 */
- "179", /* 179 */
- "180", /* 180 */
- "181", /* 181 */
- "182", /* 182 */
- "sigpending", /* 183 */
- "query_module", /* 184 */
- "setpgid", /* 185 */
- "186", /* 186 */
- "187", /* 187 */
- "188", /* 188 */
- "uname", /* 189 */
- "init_module", /* 190 */
- "personality", /* 191 */
- "192", /* 192 */
- "193", /* 193 */
- "194", /* 194 */
- "195", /* 195 */
- "196", /* 196 */
- "getppid", /* 197 */
- "sigaction", /* 198 */
- "sgetmask", /* 199 */
- "ssetmask", /* 200 */
- "sigsuspend", /* 201 */
- "oldlstat", /* 202 */
- "uselib", /* 203 */
- "readdir", /* 204 */
- "205", /* 205 */
- "socketcall", /* 206 */
- "syslog", /* 207 */
- "208", /* 208 */
- "209", /* 209 */
- "idle", /* 210 */
- "211", /* 211 */
- "waitpid", /* 212 */
- "swapoff", /* 213 */
- "sysinfo", /* 214 */
- "ipc", /* 215 */
- "sigreturn", /* 216 */
- "clone", /* 217 */
- "218", /* 218 */
- "adjtimex", /* 219 */
- "sigprocmask", /* 220 */
- "create_module", /* 221 */
- "delete_module", /* 222 */
- "get_kernel_syms", /* 223 */
- "getpgid", /* 224 */
- "bdflush", /* 225 */
- "sysfs", /* 226 */
- "afs_syscall", /* 227 */
- "setfsuid", /* 228 */
- "setfsgid", /* 229 */
- "_newselect", /* 230 */
- "time", /* 231 */
- "232", /* 232 */
- "stime", /* 233 */
- "234", /* 234 */
- "235", /* 235 */
- "_llseek", /* 236 */
- "mlock", /* 237 */
- "munlock", /* 238 */
- "mlockall", /* 239 */
- "munlockall", /* 240 */
- "sched_setparam", /* 241 */
- "sched_getparam", /* 242 */
- "sched_setscheduler", /* 243 */
- "sched_getscheduler", /* 244 */
- "sched_yield", /* 245 */
- "sched_get_priority_max", /* 246 */
- "sched_get_priority_min", /* 247 */
- "sched_rr_get_interval", /* 248 */
- "nanosleep", /* 249 */
- "mremap", /* 250 */
- "_sysctl", /* 251 */
- "getsid", /* 252 */
- "fdatasync", /* 253 */
- "nfsservctl", /* 254 */
- "aplib", /* 255 */
+ "0", /* 0 */
+ "exit", /* 1 */
+ "fork", /* 2 */
+ "read", /* 3 */
+ "write", /* 4 */
+ "open", /* 5 */
+ "close", /* 6 */
+ "wait4", /* 7 */
+ "creat", /* 8 */
+ "link", /* 9 */
+ "unlink", /* 10 */
+ "execv", /* 11 */
+ "chdir", /* 12 */
+ "chown", /* 13 */
+ "mknod", /* 14 */
+ "chmod", /* 15 */
+ "lchown", /* 16 */
+ "brk", /* 17 */
+ "perfctr", /* 18 */
+ "lseek", /* 19 */
+ "getpid", /* 20 */
+ "capget", /* 21 */
+ "capset", /* 22 */
+ "setuid", /* 23 */
+ "getuid", /* 24 */
+ "25", /* 25 */
+ "ptrace", /* 26 */
+ "alarm", /* 27 */
+ "sigaltstack", /* 28 */
+ "pause", /* 29 */
+ "utime", /* 30 */
+ "lchown32", /* 31 */
+ "fchown32", /* 32 */
+ "access", /* 33 */
+ "nice", /* 34 */
+ "chown32", /* 35 */
+ "sync", /* 36 */
+ "kill", /* 37 */
+ "stat", /* 38 */
+ "sendfile", /* 39 */
+ "lstat", /* 40 */
+ "dup", /* 41 */
+ "pipe", /* 42 */
+ "times", /* 43 */
+ "getuid32", /* 44 */
+ "umount2", /* 45 */
+ "setgid", /* 46 */
+ "getgid", /* 47 */
+ "signal", /* 48 */
+ "geteuid", /* 49 */
+ "getegid", /* 50 */
+ "acct", /* 51 */
+ "memory_ordering", /* 52 */
+ "getgid32", /* 53 */
+ "ioctl", /* 54 */
+ "reboot", /* 55 */
+ "mmap2", /* 56 */
+ "symlink", /* 57 */
+ "readlink", /* 58 */
+ "execve", /* 59 */
+ "umask", /* 60 */
+ "chroot", /* 61 */
+ "fstat", /* 62 */
+ "fstat64", /* 63 */
+ "getpagesize", /* 64 */
+ "msync", /* 65 */
+ "vfork", /* 66 */
+ "pread64", /* 67 */
+ "pwrite64", /* 68 */
+ "geteuid32", /* 69 */
+ "getegid32", /* 70 */
+ "mmap", /* 71 */
+ "setreuid32", /* 72 */
+ "munmap", /* 73 */
+ "mprotect", /* 74 */
+ "madvise", /* 75 */
+ "vhangup", /* 76 */
+ "truncate64", /* 77 */
+ "mincore", /* 78 */
+ "getgroups", /* 79 */
+ "setgroups", /* 80 */
+ "getpgrp", /* 81 */
+ "setgroups32", /* 82 */
+ "setitimer", /* 83 */
+ "ftruncate64", /* 84 */
+ "swapon", /* 85 */
+ "getitimer", /* 86 */
+ "setuid32", /* 87 */
+ "sethostname", /* 88 */
+ "setgid32", /* 89 */
+ "dup2", /* 90 */
+ "setfsuid32", /* 91 */
+ "fcntl", /* 92 */
+ "select", /* 93 */
+ "setfsgid32", /* 94 */
+ "fsync", /* 95 */
+ "setpriority", /* 96 */
+ "socket", /* 97 */
+ "connect", /* 98 */
+ "accept", /* 99 */
+ "getpriority", /* 100 */
+ "rt_sigreturn", /* 101 */
+ "rt_sigaction", /* 102 */
+ "rt_sigprocmask", /* 103 */
+ "rt_sigpending", /* 104 */
+ "rt_sigtimedwait", /* 105 */
+ "rt_sigqueueinfo", /* 106 */
+ "rt_sigsuspend", /* 107 */
+ "setresuid32", /* 108 */
+ "getresuid32", /* 109 */
+ "setresgid32", /* 110 */
+ "getresgid32", /* 111 */
+ "setregid32", /* 112 */
+ "recvmsg", /* 113 */
+ "sendmsg", /* 114 */
+ "getgroups32", /* 115 */
+ "gettimeofday", /* 116 */
+ "getrusage", /* 117 */
+ "getsockopt", /* 118 */
+ "getcwd", /* 119 */
+ "readv", /* 120 */
+ "writev", /* 121 */
+ "settimeofday", /* 122 */
+ "fchown", /* 123 */
+ "fchmod", /* 124 */
+ "recvfrom", /* 125 */
+ "setreuid", /* 126 */
+ "setregid", /* 127 */
+ "rename", /* 128 */
+ "truncate", /* 129 */
+ "ftruncate", /* 130 */
+ "flock", /* 131 */
+ "lstat64", /* 132 */
+ "sendto", /* 133 */
+ "shutdown", /* 134 */
+ "socketpair", /* 135 */
+ "mkdir", /* 136 */
+ "rmdir", /* 137 */
+ "utimes", /* 138 */
+ "stat64", /* 139 */
+ "sendfile64", /* 140 */
+ "getpeername", /* 141 */
+ "futex", /* 142 */
+ "gettid", /* 143 */
+ "getrlimit", /* 144 */
+ "setrlimit", /* 145 */
+ "pivot_root", /* 146 */
+ "prctl", /* 147 */
+ "pciconfig_read", /* 148 */
+ "pciconfig_write", /* 149 */
+ "getsockname", /* 150 */
+ "151", /* 151 */
+ "152", /* 152 */
+ "poll", /* 153 */
+ "getdents64", /* 154 */
+ "fcntl64", /* 155 */
+ "156", /* 156 */
+ "statfs", /* 157 */
+ "fstatfs", /* 158 */
+ "umount", /* 159 */
+ "sched_set_affinity", /* 160 */
+ "sched_get_affinity", /* 161 */
+ "getdomainname", /* 162 */
+ "setdomainname", /* 163 */
+ "utrap_install", /* 164 */
+ "quotactl", /* 165 */
+ "set_tid_address", /* 166 */
+ "mount", /* 167 */
+ "ustat", /* 168 */
+ "setxattr", /* 169 */
+ "lsetxattr", /* 170 */
+ "fsetxattr", /* 171 */
+ "getxattr", /* 172 */
+ "lgetxattr", /* 173 */
+ "getdents", /* 174 */
+ "setsid", /* 175 */
+ "fchdir", /* 176 */
+ "fgetxattr", /* 177 */
+ "listxattr", /* 178 */
+ "llistxattr", /* 179 */
+ "flistxattr", /* 180 */
+ "removexattr", /* 181 */
+ "lremovexattr", /* 182 */
+ "sigpending", /* 183 */
+ "query_module", /* 184 */
+ "setpgid", /* 185 */
+ "fremovexattr", /* 186 */
+ "tkill", /* 187 */
+ "exit_group", /* 188 */
+ "uname", /* 189 */
+ "init_module", /* 190 */
+ "personality", /* 191 */
+ "remap_file_pages", /* 192 */
+ "epoll_create", /* 193 */
+ "epoll_ctl", /* 194 */
+ "epoll_wait", /* 195 */
+ "196", /* 196 */
+ "getppid", /* 197 */
+ "sigaction", /* 198 */
+ "sgetmask", /* 199 */
+ "ssetmask", /* 200 */
+ "sigsuspend", /* 201 */
+ "oldlstat", /* 202 */
+ "uselib", /* 203 */
+ "readdir", /* 204 */
+ "readahead", /* 205 */
+ "socketcall", /* 206 */
+ "syslog", /* 207 */
+ "lookup_dcookie", /* 208 */
+ "fadvise64", /* 209 */
+ "fadvise64_64", /* 210 */
+ "tgkill", /* 211 */
+ "waitpid", /* 212 */
+ "swapoff", /* 213 */
+ "sysinfo", /* 214 */
+ "ipc", /* 215 */
+ "sigreturn", /* 216 */
+ "clone", /* 217 */
+ "218", /* 218 */
+ "adjtimex", /* 219 */
+ "sigprocmask", /* 220 */
+ "create_module", /* 221 */
+ "delete_module", /* 222 */
+ "get_kernel_syms", /* 223 */
+ "getpgid", /* 224 */
+ "bdflush", /* 225 */
+ "sysfs", /* 226 */
+ "afs_syscall", /* 227 */
+ "setfsuid", /* 228 */
+ "setfsgid", /* 229 */
+ "_newselect", /* 230 */
+ "time", /* 231 */
+ "232", /* 232 */
+ "stime", /* 233 */
+ "statfs64", /* 234 */
+ "fstatfs64", /* 235 */
+ "_llseek", /* 236 */
+ "mlock", /* 237 */
+ "munlock", /* 238 */
+ "mlockall", /* 239 */
+ "munlockall", /* 240 */
+ "sched_setparam", /* 241 */
+ "sched_getparam", /* 242 */
+ "sched_setscheduler", /* 243 */
+ "sched_getscheduler", /* 244 */
+ "sched_yield", /* 245 */
+ "sched_get_priority_max", /* 246 */
+ "sched_get_priority_min", /* 247 */
+ "sched_rr_get_interval", /* 248 */
+ "nanosleep", /* 249 */
+ "mremap", /* 250 */
+ "_sysctl", /* 251 */
+ "getsid", /* 252 */
+ "fdatasync", /* 253 */
+ "nfsservctl", /* 254 */
+ "aplib", /* 255 */
+ "clock_settime", /* 256 */
+ "clock_gettime", /* 257 */
+ "clock_getres", /* 258 */
+ "clock_nanosleep", /* 259 */
+ "sched_getaffinity", /* 260 */
+ "sched_setaffinity", /* 261 */
+ "timer_settime", /* 262 */
+ "timer_gettime", /* 263 */
+ "timer_getoverrun", /* 264 */
+ "timer_delete", /* 265 */
+ "timer_create", /* 266 */
+ "vserver", /* 267 */
+ "io_setup", /* 268 */
+ "io_destroy", /* 269 */
+ "io_submit", /* 270 */
+ "io_cancel", /* 271 */
+ "io_getevents", /* 272 */
+ "mq_open", /* 273 */
+ "mq_unlink", /* 274 */
+ "mq_timedsend", /* 275 */
+ "mq_timedreceive", /* 276 */
+ "mq_notify", /* 277 */
+ "mq_getsetattr", /* 278 */
+ "waitid", /* 279 */
diff --git a/sysdeps/linux-gnu/x86_64/Makefile b/sysdeps/linux-gnu/x86_64/Makefile
index 0319ab0..0a19c97 100644
--- a/sysdeps/linux-gnu/x86_64/Makefile
+++ b/sysdeps/linux-gnu/x86_64/Makefile
@@ -1,9 +1,9 @@
-OBJ = trace.o regs.o ffcheck.o
+OBJ = trace.o regs.o plt.o
all: arch.o
arch.o: $(OBJ)
- $(LD) -r -o arch.o $(OBJ)
+ $(CC) -nostdlib -r -o arch.o $(OBJ)
clean:
$(RM) $(OBJ) arch.o
diff --git a/sysdeps/linux-gnu/x86_64/arch.h b/sysdeps/linux-gnu/x86_64/arch.h
index aa61505..a7c8816 100644
--- a/sysdeps/linux-gnu/x86_64/arch.h
+++ b/sysdeps/linux-gnu/x86_64/arch.h
@@ -2,5 +2,5 @@
#define BREAKPOINT_LENGTH 1
#define DECR_PC_AFTER_BREAK 1
-#define FILEFORMAT_CHECK 1
-#define ELFSIZE 64
+#define LT_ELFCLASS ELFCLASS64
+#define LT_ELF_MACHINE EM_X86_64
diff --git a/sysdeps/linux-gnu/x86_64/ffcheck.c b/sysdeps/linux-gnu/x86_64/ffcheck.c
index 91dc855..e69de29 100644
--- a/sysdeps/linux-gnu/x86_64/ffcheck.c
+++ b/sysdeps/linux-gnu/x86_64/ffcheck.c
@@ -1,18 +0,0 @@
-#include <elf.h>
-
-int
-ffcheck (void *maddr)
-{
- Elf64_Ehdr *ehdr=maddr;
-
- if (! ehdr)
- return 0;
- if (
- ehdr->e_type == 2 &&
- ehdr->e_machine == 0x3e &&
- ehdr->e_version == 1
- )
- return 1;
-
- return 0;
-}
diff --git a/sysdeps/linux-gnu/x86_64/plt.c b/sysdeps/linux-gnu/x86_64/plt.c
new file mode 100644
index 0000000..e40b03a
--- /dev/null
+++ b/sysdeps/linux-gnu/x86_64/plt.c
@@ -0,0 +1,9 @@
+#include <gelf.h>
+#include "ltrace.h"
+#include "elf.h"
+
+GElf_Addr
+arch_plt_sym_val (struct ltelf *lte, size_t ndx, GElf_Rela *rela)
+{
+ return lte->plt_addr + (ndx + 1) * 16;
+}
diff --git a/sysdeps/linux-gnu/x86_64/syscallent.h b/sysdeps/linux-gnu/x86_64/syscallent.h
index 2b56c95..31aa74a 100644
--- a/sysdeps/linux-gnu/x86_64/syscallent.h
+++ b/sysdeps/linux-gnu/x86_64/syscallent.h
@@ -201,3 +201,48 @@
"tkill", /* 200 */
"time", /* 201 */
"futex", /* 202 */
+ "sched_setaffinity", /* 203 */
+ "sched_getaffinity", /* 204 */
+ "set_thread_area", /* 205 */
+ "io_setup", /* 206 */
+ "io_destroy", /* 207 */
+ "io_getevents", /* 208 */
+ "io_submit", /* 209 */
+ "io_cancel", /* 210 */
+ "get_thread_area", /* 211 */
+ "lookup_dcookie", /* 212 */
+ "epoll_create", /* 213 */
+ "epoll_ctl", /* 214 */
+ "epoll_wait", /* 215 */
+ "remap_file_pages", /* 216 */
+ "getdents64", /* 217 */
+ "set_tid_address", /* 218 */
+ "restart_syscall", /* 219 */
+ "semtimedop", /* 220 */
+ "fadvise64", /* 221 */
+ "timer_create", /* 222 */
+ "timer_settime", /* 223 */
+ "timer_gettime", /* 224 */
+ "timer_getoverrun", /* 225 */
+ "timer_delete", /* 226 */
+ "clock_settime", /* 227 */
+ "clock_gettime", /* 228 */
+ "clock_getres", /* 229 */
+ "clock_nanosleep", /* 230 */
+ "exit_group", /* 231 */
+ "epoll_wait", /* 232 */
+ "epoll_ctl", /* 233 */
+ "tgkill", /* 234 */
+ "utimes", /* 235 */
+ "vserver", /* 236 */
+ "mbind", /* 237 */
+ "set_mempolicy", /* 238 */
+ "get_mempolicy", /* 239 */
+ "mq_open", /* 240 */
+ "mq_unlink", /* 241 */
+ "mq_timedsend", /* 242 */
+ "mq_timedreceive", /* 243 */
+ "mq_notify", /* 244 */
+ "mq_getsetattr", /* 245 */
+ "kexec_load", /* 246 */
+ "waitid", /* 247 */