[project @ 2004-12-08 12:05:51 by simonmar]
authorsimonmar <unknown>
Wed, 8 Dec 2004 12:05:51 +0000 (12:05 +0000)
committersimonmar <unknown>
Wed, 8 Dec 2004 12:05:51 +0000 (12:05 +0000)
commitc418e72f39aee1510267d5c96fd4d7227cd455d9
treea68817c3664634aa83061e575ccccbd2d2977caa
parent8d750a5cede36c5f2767b7c869adc4f42f839871
[project @ 2004-12-08 12:05:51 by simonmar]
Fix bug #1073501: checkProddableBlock: invalid fixup in runtime linker

The bug manifested when trying to load an object with debugging info
(compiled with gcc -g) into GHCi.

The problem was that the object loader was ignoring the sections
containing debugging info, but then it was later trying to do
relocations for those sections, and its own sanity checking code
correctly detected that the relocations were in unknown parts of the
object file.

The fix is to ignore relocations whose target section isn't one of the
sections that we're interested in, using the same test in both cases
(the code to test section kind has been extracted).  The code could
probably benefit from more refactoring: it looks like the list of
sections we build up in the first phase isn't even used in the second
phase, instead we traverse the section table in the image again.  This
looks like cruft leftover from when the GC used to check whether an
address was in text or data space.
ghc/rts/Linker.c