aboutsummaryrefslogtreecommitdiff
path: root/ld/emulparams
diff options
context:
space:
mode:
authorJose E. Marchesi <jose.marchesi@oracle.com>2019-08-07 11:40:55 +0200
committerJose E. Marchesi <jose.marchesi@oracle.com>2019-08-07 13:57:30 +0200
commitfca8e23c31e6ec37bdcb5cf1d981a39d1e6fb6f6 (patch)
tree479748460853db0e6bd2bc62f6c80049c6b77c2e /ld/emulparams
parentfc8de8e227e5146336d654f2fb4f98010d7cf12d (diff)
downloadgdb-fca8e23c31e6ec37bdcb5cf1d981a39d1e6fb6f6.zip
gdb-fca8e23c31e6ec37bdcb5cf1d981a39d1e6fb6f6.tar.gz
gdb-fca8e23c31e6ec37bdcb5cf1d981a39d1e6fb6f6.tar.bz2
ld: use a specific linker script in BPF targets
This patch makes the elf64bpf emulation to use it's own linker script, based on elf.sc. At the moment, the only change is that the BPF executable doesn't define an entry symbol (BPF programs feature several entry points scattered in several sections.) This is a step towards the goal of generating proper ELF executables that would be loaded by the kernel's libbpf. We are not there yet: BPF "programs" should still be linked with -r. This change removes a warning while linking executables, decreases the number of unsupported tests in the target from 47 to 29, and increases the number of expected passes from 104 to 145. Regtested in x86_64 for all targets. No regressions. ld/ChangeLog: 2019-08-07 Jose E. Marchesi <jose.marchesi@oracle.com> * scripttempl/elf64bpf.sc: Adapted from elf.sc. * emulparams/elf64bpf.sh (SCRIPT_NAME): Use elf64bpf. (EMBEDDED): Define. * testsuite/ld-bpf/call-1.d: Do not expect a warning regarding an undefined entry symbol. * testsuite/ld-bpf/jump-1.d: Likewise. * testsuite/ld-undefined/undefined.exp: Do not pass '-e entry' to ld in BPF targets, and do not expect line number information. * testsuite/ld-srec/srec.exp (run_srec_test): xfail s-record tests in BPF targets.
Diffstat (limited to 'ld/emulparams')
-rw-r--r--ld/emulparams/elf64bpf.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/ld/emulparams/elf64bpf.sh b/ld/emulparams/elf64bpf.sh
index 39b23f0..94a7580 100644
--- a/ld/emulparams/elf64bpf.sh
+++ b/ld/emulparams/elf64bpf.sh
@@ -1,5 +1,5 @@
TEMPLATE_NAME=elf32
-SCRIPT_NAME=elf
+SCRIPT_NAME=elf64bpf
BIG_OUTPUT_FORMAT="elf64-bpfbe"
LITTLE_OUTPUT_FORMAT="elf64-bpfle"
OUTPUT_FORMAT="$LITTLE_OUTPUT_FORMAT"
@@ -8,3 +8,4 @@ MACHINE=
TARGET_PAGE_SIZE=0x1000
# XXX this is arbitrary, for now
TEXT_START_ADDR=0x00400000
+EMBEDDED=yes