diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2015-01-22 19:18:16 +0100 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2015-01-22 19:18:16 +0100 |
commit | 4b62a76e0cd716407859077467fddbb66b715a43 (patch) | |
tree | 1c052819816f43decc7f18570f2a83ed42a9e66a /gdb/compile | |
parent | 82a864f96aff83edb0c8bb21ead5c28cd10363fe (diff) | |
download | gdb-4b62a76e0cd716407859077467fddbb66b715a43.zip gdb-4b62a76e0cd716407859077467fddbb66b715a43.tar.gz gdb-4b62a76e0cd716407859077467fddbb66b715a43.tar.bz2 |
compile: Fix function pointers
TBH while I always comment reasons for each of the compilation options in
reality I tried them all and chose that combination that needs the most simple
compile/compile-object-load.c (ld.so emulation) implementation.
gdb/ChangeLog
2015-01-22 Jan Kratochvil <jan.kratochvil@redhat.com>
* compile/compile.c (_initialize_compile): Use -fPIE for compile_args.
gdb/testsuite/ChangeLog
2015-01-22 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.compile/compile.exp (pointer to jit function): New test.
Diffstat (limited to 'gdb/compile')
-rw-r--r-- | gdb/compile/compile.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c index ccac49d..70b6d44 100644 --- a/gdb/compile/compile.c +++ b/gdb/compile/compile.c @@ -645,12 +645,13 @@ String quoting is parsed like in shell, for example:\n\ /* Override flags possibly coming from DW_AT_producer. */ compile_args = xstrdup ("-O0 -gdwarf-4" - /* We use -fPIC Otherwise GDB would need to reserve space large enough for + /* We use -fPIE Otherwise GDB would need to reserve space large enough for any object file in the inferior in advance to get the final address when to link the object file to and additionally the default system linker script would need to be modified so that one can specify there the - absolute target address. */ - " -fPIC" + absolute target address. + -fPIC is not used at is would require from GDB to generate .got. */ + " -fPIE" /* We don't want warnings. */ " -w" /* Override CU's possible -fstack-protector-strong. */ |