[PATCH] dwarf: Bail out if debug info needs relocation
H.J. Lu
hjl.tools@gmail.com
Fri Sep 7 19:58:00 GMT 2018
More information about the Binutils mailing list
Fri Sep 7 19:58:00 GMT 2018
- Previous message (by thread): Support objcopy --remove-section=.relaFOO
- Next message (by thread): [PATCH] dwarf: Bail out if debug info needs relocation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
find_abstract_instance may work only with relocated files. When debug info needs relocation, bfd should bail out instead of issuing an error. For the testcase at https://sourceware.org/bugzilla/show_bug.cgi?id=23425#c1 now we get $ ./ld ccELcIbzdebugobjtem cccLlhS9debugobjtem ccqD9BbN.ltrans0.ltrans.o ./ld: warning: cannot find entry symbol _start; defaulting to 0000000000401000 ./ld: ccqD9BbN.ltrans0.ltrans.o: in function `strerrno(int)': /abuild/rguenther/obj-sccvn-g/gcc/cpputil.cpp:16: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()' ./ld: /abuild/rguenther/obj-sccvn-g/gcc/cpputil.cpp:22: undefined reference to `strerrno_s(char*, unsigned long, int)' ./ld: /abuild/rguenther/obj-sccvn-g/gcc/cpputil.cpp:25: undefined reference to `std::string::operator=(char const*)' ./ld: /abuild/rguenther/obj-sccvn-g/gcc/cpputil.cpp:27: undefined reference to `std::string::operator+=(char const*)' ./ld: /abuild/rguenther/obj-sccvn-g/gcc/cpputil.cpp:31: undefined reference to `std::string::operator=(char const*)' ./ld: /abuild/rguenther/obj-sccvn-g/gcc/cpputil.cpp:34: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' ./ld: /abuild/rguenther/obj-sccvn-g/gcc/cpputil.cpp:34: undefined reference to `_Unwind_Resume' ./ld: ccqD9BbN.ltrans0.ltrans.o:(.eh_frame+0x4b): undefined reference to `__gcc_personality_v0' $ PR ld/23425 * dwarf2.c (find_abstract_instance): Bail out if debug info needs relocation. --- bfd/dwarf2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 8fadb5c4b6..bce5db9c7e 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -2839,6 +2839,9 @@ find_abstract_instance (struct comp_unit * unit, total = info_ptr_end - info_ptr; if (!die_ref || die_ref >= total) { + /* Bail out if the debug info needs relocation. */ + if ((unit->stash->sec->flags & SEC_RELOC)) + return TRUE; _bfd_error_handler (_("DWARF error: invalid abstract instance DIE ref")); bfd_set_error (bfd_error_bad_value); -- 2.17.1
- Previous message (by thread): Support objcopy --remove-section=.relaFOO
- Next message (by thread): [PATCH] dwarf: Bail out if debug info needs relocation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list