From da83f611c3ba625ba3515197af7996a522b39678 Mon Sep 17 00:00:00 2001 From: Andrew Gallatin Date: Fri, 20 Aug 1999 14:21:35 +0000 Subject: [PATCH] Fix a nasty kld bug where modules with objects of type GLOB_DAT which had non-zero addends were being loaded incorrectly --- sys/alpha/alpha/elf_machdep.c | 3 ++- sys/powerpc/powerpc/elf_machdep.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/alpha/alpha/elf_machdep.c b/sys/alpha/alpha/elf_machdep.c index 2c559a54b3be..646e3536573e 100644 --- a/sys/alpha/alpha/elf_machdep.c +++ b/sys/alpha/alpha/elf_machdep.c @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: elf_machdep.c,v 1.4 1999/04/23 19:53:37 dt Exp $ + * $Id: elf_machdep.c,v 1.5 1999/07/16 09:16:11 dfr Exp $ */ #include @@ -85,6 +85,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym) linker_file_lookup_symbol(lf, sym, 1); if (addr == NULL) return -1; + addr += addend; if (*where != addr) *where = addr; break; diff --git a/sys/powerpc/powerpc/elf_machdep.c b/sys/powerpc/powerpc/elf_machdep.c index 2c559a54b3be..646e3536573e 100644 --- a/sys/powerpc/powerpc/elf_machdep.c +++ b/sys/powerpc/powerpc/elf_machdep.c @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: elf_machdep.c,v 1.4 1999/04/23 19:53:37 dt Exp $ + * $Id: elf_machdep.c,v 1.5 1999/07/16 09:16:11 dfr Exp $ */ #include @@ -85,6 +85,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym) linker_file_lookup_symbol(lf, sym, 1); if (addr == NULL) return -1; + addr += addend; if (*where != addr) *where = addr; break;