From 3a8fa2282b180a1dc49dae5ae27170d36a7e8029 Mon Sep 17 00:00:00 2001 From: Christian Biesinger Date: Fri, 22 Nov 2019 11:03:15 -0600 Subject: [PATCH] Fix (most) OpenBSD link errors This fixes these errors: ld: error: undefined symbol: x86_stopped_by_hw_breakpoint() >>> referenced by x86-nat.h:109 (../../gdb/x86-nat.h:109) >>> amd64-obsd-nat.o:(x86_nat_target::stopped_by_hw_breakpoint()) ld: error: undefined symbol: x86_can_use_hw_breakpoint(bptype, int, int) >>> referenced by x86-nat.h:76 (../../gdb/x86-nat.h:76) >>> amd64-obsd-nat.o:(x86_nat_target::can_use_hw_breakpoint(bptype, int, int)) ld: error: undefined symbol: x86_insert_hw_breakpoint(gdbarch*, bp_target_info*) >>> referenced by x86-nat.h:93 (../../gdb/x86-nat.h:93) >>> amd64-obsd-nat.o:(x86_nat_target::insert_hw_breakpoint(gdbarch*, bp_target_info*)) ld: error: undefined symbol: x86_remove_hw_breakpoint(gdbarch*, bp_target_info*) >>> referenced by x86-nat.h:97 (../../gdb/x86-nat.h:97) >>> amd64-obsd-nat.o:(x86_nat_target::remove_hw_breakpoint(gdbarch*, bp_target_info*)) ld: error: undefined symbol: x86_remove_watchpoint(unsigned long, int, target_hw_bp_type, expression*) >>> referenced by x86-nat.h:89 (../../gdb/x86-nat.h:89) >>> amd64-obsd-nat.o:(x86_nat_target::remove_watchpoint(unsigned long, int, target_hw_bp_type, expression*)) ld: error: undefined symbol: x86_insert_watchpoint(unsigned long, int, target_hw_bp_type, expression*) >>> referenced by x86-nat.h:84 (../../gdb/x86-nat.h:84) >>> amd64-obsd-nat.o:(x86_nat_target::insert_watchpoint(unsigned long, int, target_hw_bp_type, expression*)) ld: error: undefined symbol: x86_stopped_by_watchpoint() >>> referenced by x86-nat.h:100 (../../gdb/x86-nat.h:100) >>> amd64-obsd-nat.o:(x86_nat_target::stopped_by_watchpoint()) ld: error: undefined symbol: x86_stopped_data_address(unsigned long*) >>> referenced by x86-nat.h:103 (../../gdb/x86-nat.h:103) >>> amd64-obsd-nat.o:(x86_nat_target::stopped_data_address(unsigned long*)) ld: error: undefined symbol: x86_region_ok_for_hw_watchpoint(unsigned long, int) >>> referenced by x86-nat.h:79 (../../gdb/x86-nat.h:79) >>> amd64-obsd-nat.o:(x86_nat_target::region_ok_for_hw_watchpoint(unsigned long, int)) and ld: error: undefined symbol: x86_dr_insert_watchpoint(x86_debug_reg_state*, target_hw_bp_type, unsigned long, int) >>> referenced by x86-nat.c:156 (../../gdb/x86-nat.c:156) >>> x86-nat.o:(x86_insert_watchpoint(unsigned long, int, target_hw_bp_type, expression*)) ld: error: undefined symbol: x86_dr_remove_watchpoint(x86_debug_reg_state*, target_hw_bp_type, unsigned long, int) >>> referenced by x86-nat.c:169 (../../gdb/x86-nat.c:169) >>> x86-nat.o:(x86_remove_watchpoint(unsigned long, int, target_hw_bp_type, expression*)) ld: error: undefined symbol: x86_dr_region_ok_for_watchpoint(x86_debug_reg_state*, unsigned long, int) >>> referenced by x86-nat.c:181 (../../gdb/x86-nat.c:181) >>> x86-nat.o:(x86_region_ok_for_hw_watchpoint(unsigned long, int)) ld: error: undefined symbol: x86_dr_stopped_data_address(x86_debug_reg_state*, unsigned long*) >>> referenced by x86-nat.c:194 (../../gdb/x86-nat.c:194) >>> x86-nat.o:(x86_stopped_data_address(unsigned long*)) ld: error: undefined symbol: x86_dr_stopped_by_watchpoint(x86_debug_reg_state*) >>> referenced by x86-nat.c:206 (../../gdb/x86-nat.c:206) >>> x86-nat.o:(x86_stopped_by_watchpoint()) ld: error: undefined symbol: x86_dr_insert_watchpoint(x86_debug_reg_state*, target_hw_bp_type, unsigned long, int) >>> referenced by x86-nat.c:219 (../../gdb/x86-nat.c:219) >>> x86-nat.o:(x86_insert_hw_breakpoint(gdbarch*, bp_target_info*)) ld: error: undefined symbol: x86_dr_remove_watchpoint(x86_debug_reg_state*, target_hw_bp_type, unsigned long, int) >>> referenced by x86-nat.c:233 (../../gdb/x86-nat.c:233) >>> x86-nat.o:(x86_remove_hw_breakpoint(gdbarch*, bp_target_info*)) ld: error: undefined symbol: x86_dr_stopped_by_hw_breakpoint(x86_debug_reg_state*) >>> referenced by x86-nat.c:269 (../../gdb/x86-nat.c:269) >>> x86-nat.o:(x86_stopped_by_hw_breakpoint()) It does not fix: ld: error: can't create dynamic relocation R_X86_64_64 against symbol: __gmp_binvert_limb_table in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in /usr/local/lib/libgmp.a(mp_minv_tab.o) >>> referenced by tmp-dive_1.s >>> dive_1.o:(__gmpn_divexact_1) in archive /usr/local/lib/libgmp.a ld: error: can't create dynamic relocation R_X86_64_64 against symbol: __gmp_binvert_limb_table in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in /usr/local/lib/libgmp.a(mp_minv_tab.o) >>> referenced by tmp-bdiv_q_1.s >>> bdiv_q_1.o:(__gmpn_bdiv_q_1) in archive /usr/local/lib/libgmp.a ld: error: can't create dynamic relocation R_X86_64_64 against symbol: __gmpn_invert_limb_table in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in /usr/local/lib/libgmp.a(invert_limb_table.o) >>> referenced by tmp-invert_limb.s >>> invert_limb.o:(__gmpn_invert_limb) in archive /usr/local/lib/libgmp.a gdb/ChangeLog: 2019-12-04 Christian Biesinger * configure.nat (obsd64): Add missing files x86-nat.o and nat/x86-dregs.o. Change-Id: I4a443c0cf805efd7b45feaabd729a01b07772724 --- gdb/ChangeLog | 5 +++++ gdb/configure.nat | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a8bafa3199c..92ee52b8a96 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-12-04 Christian Biesinger + + * configure.nat (obsd64): Add missing files x86-nat.o and + nat/x86-dregs.o. + 2019-12-04 Tom Tromey * valprint.c (val_print_string): Use metadata_style. diff --git a/gdb/configure.nat b/gdb/configure.nat index 77a2ee80839..90339367815 100644 --- a/gdb/configure.nat +++ b/gdb/configure.nat @@ -445,8 +445,9 @@ case ${gdb_host} in case ${gdb_host_cpu} in i386) # Host: OpenBSD/amd64 - NATDEPFILES="${NATDEPFILES} obsd-nat.o amd64-nat.o \ - x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o" + NATDEPFILES="${NATDEPFILES} obsd-nat.o amd64-nat.o x86-nat.o \ + x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o \ + nat/x86-dregs.o" LOADLIBES='-lkvm' ;; mips) -- 2.30.2