diff options
author | dfr <dfr@FreeBSD.org> | 1998-10-18 19:04:13 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1998-10-18 19:04:13 +0000 |
commit | dc962160ec09207e647eeabe59f0cae164e19ffb (patch) | |
tree | 192c75af415d058029bb4ae3039c3772cb97a4a9 | |
parent | dd72da46f86b4001c9a2c8ada8a3134c61d1119c (diff) | |
download | FreeBSD-src-dc962160ec09207e647eeabe59f0cae164e19ffb.zip FreeBSD-src-dc962160ec09207e647eeabe59f0cae164e19ffb.tar.gz |
R_ALPHA_RELATIVE relocations need to add the value to the existing memory
contents.
-rw-r--r-- | sys/alpha/alpha/elf_machdep.c | 6 | ||||
-rw-r--r-- | sys/powerpc/powerpc/elf_machdep.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/alpha/alpha/elf_machdep.c b/sys/alpha/alpha/elf_machdep.c index 847ab2a..785e2ed 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.1 1998/09/11 08:47:02 dfr Exp $ + * $Id: elf_machdep.c,v 1.2 1998/10/16 03:54:59 peter Exp $ */ #include <sys/param.h> @@ -97,7 +97,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym) break; case R_ALPHA_RELATIVE: - addr = relocbase + addend; + addr = relocbase + addend + *where; if (*where != addr) *where = addr; break; @@ -112,7 +112,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym) default: printf("kldload: unexpected relocation type %d\n", - rtype); + (int) rtype); return -1; } return(0); diff --git a/sys/powerpc/powerpc/elf_machdep.c b/sys/powerpc/powerpc/elf_machdep.c index 847ab2a..785e2ed 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.1 1998/09/11 08:47:02 dfr Exp $ + * $Id: elf_machdep.c,v 1.2 1998/10/16 03:54:59 peter Exp $ */ #include <sys/param.h> @@ -97,7 +97,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym) break; case R_ALPHA_RELATIVE: - addr = relocbase + addend; + addr = relocbase + addend + *where; if (*where != addr) *where = addr; break; @@ -112,7 +112,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym) default: printf("kldload: unexpected relocation type %d\n", - rtype); + (int) rtype); return -1; } return(0); |