public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libdwfl: Allow partial relocations also for debug files.
@ 2018-05-27 12:13 Mark Wielaard
  2018-05-29 10:12 ` Mark Wielaard
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Wielaard @ 2018-05-27 12:13 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

__libdwfl_relocate is called for get_dwarf and get_elf. We allow not all
relocations to be resolved for Elf files, but required all relocations
(in the debug sections) to be fully resoled in Dwarf files. This used to
mostly work out with .o ET_REL files when the main Elf was gotten before
the Dwarf. But with .dwo files, we (readelf) might open the .o file just
for the (skeleton) Dwarf. In this case it could happen not all relocations
in the debug sections could be resolved (.debug_info and .debug_addr might
contain referenes to undefined symbols). So allow partial relocations
also for debug files.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 libdwfl/ChangeLog  | 5 +++++
 libdwfl/relocate.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index d69fe0c..34aa07d 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-27  Mark Wielaard  <mark@klomp.org>
+
+	* relocate.c (__libdwfl_relocate): Always call relocate_section with
+	partial true.
+
 2018-05-17  Mark Wielaard  <mark@klomp.org>
 
 	* dwfl_module (__libdwfl_module_free): Free elfdir.
diff --git a/libdwfl/relocate.c b/libdwfl/relocate.c
index 1768243..9afcdeb 100644
--- a/libdwfl/relocate.c
+++ b/libdwfl/relocate.c
@@ -751,7 +751,7 @@ __libdwfl_relocate (Dwfl_Module *mod, Elf *debugfile, bool debug)
 	  else
 	    result = relocate_section (mod, debugfile, ehdr, d_shstrndx,
 				       &reloc_symtab, scn, shdr, tscn,
-				       debug, !debug);
+				       debug, true /* partial always OK. */);
 	}
     }
 
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libdwfl: Allow partial relocations also for debug files.
  2018-05-27 12:13 [PATCH] libdwfl: Allow partial relocations also for debug files Mark Wielaard
@ 2018-05-29 10:12 ` Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2018-05-29 10:12 UTC (permalink / raw)
  To: elfutils-devel

On Sun, 2018-05-27 at 14:13 +0200, Mark Wielaard wrote:
> __libdwfl_relocate is called for get_dwarf and get_elf. We allow not all
> relocations to be resolved for Elf files, but required all relocations
> (in the debug sections) to be fully resoled in Dwarf files. This used to
> mostly work out with .o ET_REL files when the main Elf was gotten before
> the Dwarf. But with .dwo files, we (readelf) might open the .o file just
> for the (skeleton) Dwarf. In this case it could happen not all relocations
> in the debug sections could be resolved (.debug_info and .debug_addr might
> contain referenes to undefined symbols). So allow partial relocations
> also for debug files.

Pushed to master.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-29 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-27 12:13 [PATCH] libdwfl: Allow partial relocations also for debug files Mark Wielaard
2018-05-29 10:12 ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).