aboutsummaryrefslogtreecommitdiff
path: root/gdb/config
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@redhat.com>2015-01-15 15:10:49 -0500
committerSergio Durigan Junior <sergiodj@redhat.com>2015-01-15 15:10:49 -0500
commit8cc73a3902a68269626274e15d7c25bef0a61759 (patch)
treeac425182a79a90d9636ec4c618f64325c062c20a /gdb/config
parentfb23d554428f1d379fd8c3e959a294108fa59f88 (diff)
downloadgdb-8cc73a3902a68269626274e15d7c25bef0a61759.zip
gdb-8cc73a3902a68269626274e15d7c25bef0a61759.tar.gz
gdb-8cc73a3902a68269626274e15d7c25bef0a61759.tar.bz2
Move code to disable ASR to nat/
This patch moves the shared code present on gdb/linux-nat.c:linux_nat_create_inferior and gdb/gdbserver/linux-low.c:linux_create_inferior to nat/linux-personality.c. This code is responsible for disabling address space randomization based on user setting, and using <sys/personality.h> to do that. I decided to put the prototype of the maybe_disable_address_space_randomization on nat/linux-osdata.h because it seemed the best place to put it. I regression-tested this patch on Fedora 20 x86_64, and found no regressions. gdb/ChangeLog 2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (HFILES_NO_SRCDIR): Add nat/linux-personality.h. (linux-personality.o): New rule. * common/common-defs.h: Include <stdint.h>. * config/aarch64/linux.mh (NATDEPFILES): Include linux-personality.o. * config/alpha/alpha-linux.mh (NATDEPFILES): Likewise. * config/arm/linux.mh (NATDEPFILES): Likewise. * config/i386/linux64.mh (NATDEPFILES): Likewise. * config/i386/linux.mh (NATDEPFILES): Likewise. * config/ia64/linux.mh (NATDEPFILES): Likewise. * config/m32r/linux.mh (NATDEPFILES): Likewise. * config/m68k/linux.mh (NATDEPFILES): Likewise. * config/mips/linux.mh (NATDEPFILES): Likewise. * config/pa/linux.mh (NATDEPFILES): Likewise. * config/powerpc/linux.mh (NATDEPFILES): Likewise. * config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise. * config/powerpc/spu-linux.mh (NATDEPFILES): Likewise. * config/s390/linux.mh (NATDEPFILES): Likewise. * config/sparc/linux64.mh (NATDEPFILES): Likewise. * config/sparc/linux.mh (NATDEPFILES): Likewise. * config/tilegx/linux.mh (NATDEPFILES): Likewise. * config/xtensa/linux.mh (NATDEPFILES): Likewise. * defs.h: Remove #include <stdint.h> (moved to common/common-defs.h). * linux-nat.c: Include nat/linux-personality.h. Remove #include <sys/personality.h>; do not define ADDR_NO_RANDOMIZE (moved to nat/linux-personality.c). (linux_nat_create_inferior): Remove code to disable address space randomization (moved to nat/linux-personality.c). Create cleanup to disable address space randomization. * nat/linux-personality.c: New file. * nat/linux-personality.h: Likewise. gdb/gdbserver/ChangeLog 2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (SFILES): Add linux-personality.c. (linux-personality.o): New rule. * configure.srv (srv_linux_obj): Add linux-personality.o to the list of objects to be built. * linux-low.c: Include nat/linux-personality.h. (linux_create_inferior): Remove code to disable address space randomization (moved to ../nat/linux-personality.c). Create cleanup to disable address space randomization.
Diffstat (limited to 'gdb/config')
-rw-r--r--gdb/config/aarch64/linux.mh3
-rw-r--r--gdb/config/alpha/alpha-linux.mh2
-rw-r--r--gdb/config/arm/linux.mh2
-rw-r--r--gdb/config/i386/linux.mh2
-rw-r--r--gdb/config/i386/linux64.mh2
-rw-r--r--gdb/config/ia64/linux.mh1
-rw-r--r--gdb/config/m32r/linux.mh2
-rw-r--r--gdb/config/m68k/linux.mh1
-rw-r--r--gdb/config/mips/linux.mh1
-rw-r--r--gdb/config/pa/linux.mh3
-rw-r--r--gdb/config/powerpc/linux.mh2
-rw-r--r--gdb/config/powerpc/ppc64-linux.mh2
-rw-r--r--gdb/config/powerpc/spu-linux.mh2
-rw-r--r--gdb/config/s390/linux.mh1
-rw-r--r--gdb/config/sparc/linux.mh3
-rw-r--r--gdb/config/sparc/linux64.mh3
-rw-r--r--gdb/config/tilegx/linux.mh3
-rw-r--r--gdb/config/xtensa/linux.mh2
18 files changed, 23 insertions, 14 deletions
diff --git a/gdb/config/aarch64/linux.mh b/gdb/config/aarch64/linux.mh
index af04f46..7f96e4d 100644
--- a/gdb/config/aarch64/linux.mh
+++ b/gdb/config/aarch64/linux.mh
@@ -21,7 +21,8 @@
NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o aarch64-linux-nat.o \
proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
- linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o
+ linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
+ linux-personality.o
NAT_CDEPS = $(srcdir)/proc-service.list
LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/alpha/alpha-linux.mh b/gdb/config/alpha/alpha-linux.mh
index 81819a1..2ea02a1 100644
--- a/gdb/config/alpha/alpha-linux.mh
+++ b/gdb/config/alpha/alpha-linux.mh
@@ -3,7 +3,7 @@ NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o alpha-linux-nat.o \
fork-child.o proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
- linux-waitpid.o
+ linux-waitpid.o linux-personality.o
NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
diff --git a/gdb/config/arm/linux.mh b/gdb/config/arm/linux.mh
index 63c3eae..549bf42 100644
--- a/gdb/config/arm/linux.mh
+++ b/gdb/config/arm/linux.mh
@@ -4,7 +4,7 @@ NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o arm-linux-nat.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
- linux-waitpid.o
+ linux-waitpid.o linux-personality.o
NAT_CDEPS = $(srcdir)/proc-service.list
LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/i386/linux.mh b/gdb/config/i386/linux.mh
index a4e4842..33fb281 100644
--- a/gdb/config/i386/linux.mh
+++ b/gdb/config/i386/linux.mh
@@ -5,7 +5,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
- linux-btrace.o linux-waitpid.o
+ linux-btrace.o linux-waitpid.o linux-personality.o
NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
diff --git a/gdb/config/i386/linux64.mh b/gdb/config/i386/linux64.mh
index d557202..d52eb52 100644
--- a/gdb/config/i386/linux64.mh
+++ b/gdb/config/i386/linux64.mh
@@ -5,7 +5,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
linux-nat.o linux-osdata.o \
proc-service.o linux-thread-db.o linux-fork.o \
linux-procfs.o linux-ptrace.o linux-btrace.o \
- linux-waitpid.o
+ linux-waitpid.o linux-personality.o
NAT_FILE= config/nm-linux.h
NAT_CDEPS = $(srcdir)/proc-service.list
diff --git a/gdb/config/ia64/linux.mh b/gdb/config/ia64/linux.mh
index baa8709..9dce22b 100644
--- a/gdb/config/ia64/linux.mh
+++ b/gdb/config/ia64/linux.mh
@@ -5,6 +5,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
ia64-linux-nat.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o \
+ linux-personality.o \
linux-procfs.o linux-ptrace.o linux-waitpid.o
NAT_CDEPS = $(srcdir)/proc-service.list
diff --git a/gdb/config/m32r/linux.mh b/gdb/config/m32r/linux.mh
index e9bb82c..6b810e6 100644
--- a/gdb/config/m32r/linux.mh
+++ b/gdb/config/m32r/linux.mh
@@ -4,7 +4,7 @@ NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o \
m32r-linux-nat.o proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
- linux-waitpid.o
+ linux-waitpid.o linux-personality.o
NAT_CDEPS = $(srcdir)/proc-service.list
LOADLIBES= -ldl $(RDYNAMIC)
diff --git a/gdb/config/m68k/linux.mh b/gdb/config/m68k/linux.mh
index bcec295..f3b3baa 100644
--- a/gdb/config/m68k/linux.mh
+++ b/gdb/config/m68k/linux.mh
@@ -5,6 +5,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
m68klinux-nat.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+ linux-personality.o \
linux-waitpid.o
NAT_CDEPS = $(srcdir)/proc-service.list
diff --git a/gdb/config/mips/linux.mh b/gdb/config/mips/linux.mh
index 021838e..d6a802f 100644
--- a/gdb/config/mips/linux.mh
+++ b/gdb/config/mips/linux.mh
@@ -4,6 +4,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o mips-linux-nat.o \
linux-thread-db.o proc-service.o \
linux-nat.o linux-osdata.o linux-fork.o \
linux-procfs.o linux-ptrace.o linux-waitpid.o \
+ linux-personality.o \
mips-linux-watch.o
NAT_CDEPS = $(srcdir)/proc-service.list
diff --git a/gdb/config/pa/linux.mh b/gdb/config/pa/linux.mh
index f1c0c32..9539b64 100644
--- a/gdb/config/pa/linux.mh
+++ b/gdb/config/pa/linux.mh
@@ -3,7 +3,8 @@ NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o \
hppa-linux-nat.o proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o \
- linux-procfs.o linux-ptrace.o linux-waitpid.o
+ linux-procfs.o linux-ptrace.o linux-waitpid.o \
+ linux-personality.o
NAT_CDEPS = $(srcdir)/proc-service.list
LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/powerpc/linux.mh b/gdb/config/powerpc/linux.mh
index a807d3f..76e62c0 100644
--- a/gdb/config/powerpc/linux.mh
+++ b/gdb/config/powerpc/linux.mh
@@ -6,7 +6,7 @@ NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o \
ppc-linux-nat.o proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
- linux-waitpid.o
+ linux-waitpid.o linux-personality.o
NAT_CDEPS = $(srcdir)/proc-service.list
LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/powerpc/ppc64-linux.mh b/gdb/config/powerpc/ppc64-linux.mh
index 1b3fbc7..7eb6507 100644
--- a/gdb/config/powerpc/ppc64-linux.mh
+++ b/gdb/config/powerpc/ppc64-linux.mh
@@ -6,7 +6,7 @@ NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o \
ppc-linux-nat.o proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
- linux-waitpid.o ppc-linux.o
+ linux-waitpid.o ppc-linux.o linux-personality.o
NAT_CDEPS = $(srcdir)/proc-service.list
# The PowerPC has severe limitations on TOC size, and uses them even
diff --git a/gdb/config/powerpc/spu-linux.mh b/gdb/config/powerpc/spu-linux.mh
index 7ce7a5f..d44aeeb 100644
--- a/gdb/config/powerpc/spu-linux.mh
+++ b/gdb/config/powerpc/spu-linux.mh
@@ -4,5 +4,5 @@
# PPU side of the Cell BE and debugging the SPU side.
NATDEPFILES = spu-linux-nat.o fork-child.o inf-ptrace.o \
- linux-procfs.o linux-ptrace.o linux-waitpid.o
+ linux-procfs.o linux-ptrace.o linux-waitpid.o linux-personality.o
diff --git a/gdb/config/s390/linux.mh b/gdb/config/s390/linux.mh
index 59bab83..e1ad899 100644
--- a/gdb/config/s390/linux.mh
+++ b/gdb/config/s390/linux.mh
@@ -3,6 +3,7 @@ NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o s390-linux-nat.o \
linux-thread-db.o proc-service.o \
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
+ linux-personality.o \
linux-waitpid.o
NAT_CDEPS = $(srcdir)/proc-service.list
LOADLIBES = -ldl $(RDYNAMIC)
diff --git a/gdb/config/sparc/linux.mh b/gdb/config/sparc/linux.mh
index 009ea95..bd7fc86 100644
--- a/gdb/config/sparc/linux.mh
+++ b/gdb/config/sparc/linux.mh
@@ -4,7 +4,8 @@ NATDEPFILES= sparc-nat.o sparc-linux-nat.o \
fork-child.o inf-ptrace.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o \
- linux-procfs.o linux-ptrace.o linux-waitpid.o
+ linux-procfs.o linux-ptrace.o linux-waitpid.o \
+ linux-personality.o
NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
diff --git a/gdb/config/sparc/linux64.mh b/gdb/config/sparc/linux64.mh
index aad77c7..86f984f 100644
--- a/gdb/config/sparc/linux64.mh
+++ b/gdb/config/sparc/linux64.mh
@@ -4,7 +4,8 @@ NATDEPFILES= sparc-nat.o sparc64-nat.o sparc64-linux-nat.o \
fork-child.o inf-ptrace.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o \
- linux-procfs.o linux-ptrace.o linux-waitpid.o
+ linux-procfs.o linux-ptrace.o linux-waitpid.o \
+ linux-personality.o
NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
diff --git a/gdb/config/tilegx/linux.mh b/gdb/config/tilegx/linux.mh
index 1ed9c33..b5edcd4 100644
--- a/gdb/config/tilegx/linux.mh
+++ b/gdb/config/tilegx/linux.mh
@@ -5,7 +5,8 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
tilegx-linux-nat.o \
proc-service.o linux-thread-db.o \
linux-nat.o linux-osdata.o linux-fork.o \
- linux-procfs.o linux-ptrace.o linux-waitpid.o
+ linux-procfs.o linux-ptrace.o linux-waitpid.o \
+ linux-personality.o
# The dynamically loaded libthread_db needs access to symbols in the
# gdb executable.
diff --git a/gdb/config/xtensa/linux.mh b/gdb/config/xtensa/linux.mh
index 8ef84b4..b4e59b3 100644
--- a/gdb/config/xtensa/linux.mh
+++ b/gdb/config/xtensa/linux.mh
@@ -5,7 +5,7 @@ NAT_FILE= config/nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o xtensa-linux-nat.o \
linux-thread-db.o proc-service.o \
linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
- linux-waitpid.o
+ linux-waitpid.o linux-personality.o
NAT_CDEPS = $(srcdir)/proc-service.list
LOADLIBES = -ldl $(RDYNAMIC)