X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FLinker.c;h=9160aea312645851e19355e87fa6434ae85a635f;hb=fb7a723bfd7650a705cb226e07c5b08b7a8e9279;hp=271aa4bce24d6fb11e3b5ffc94eebaedf0cef662;hpb=9c5f23d4e31b06a3d6ec8eca7c82934571c348de;p=ghc-hetmet.git diff --git a/ghc/rts/Linker.c b/ghc/rts/Linker.c index 271aa4b..9160aea 100644 --- a/ghc/rts/Linker.c +++ b/ghc/rts/Linker.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Linker.c,v 1.63 2001/09/04 16:33:04 sewardj Exp $ + * $Id: Linker.c,v 1.65 2001/09/04 18:29:21 ken Exp $ * * (c) The GHC Team, 2000, 2001 * @@ -287,7 +287,7 @@ typedef struct _RtsSymbolVal { Sym(StgReturn) \ Sym(init_stack) \ SymX(cmp_thread) \ - Sym(__init_PrelGHC) \ + Sym(__stginit_PrelGHC) \ SymX(freeHaskellFunctionPtr) \ SymX(OnExitHook) \ SymX(ErrorHdrHook) \ @@ -1699,11 +1699,7 @@ ocGetNames_ELF ( ObjectCode* oc ) } k = 0; - oc->n_sections = ehdr->e_shnum; - oc->sections = stgMallocBytes( oc->n_sections * sizeof(Section), - "ocGetNames_ELF(oc->sections)" ); - - for (i = 0; i < oc->n_sections; i++) { + for (i = 0; i < ehdr->e_shnum; i++) { /* make a section entry for relevant sections */ SectionKind kind = SECTIONKIND_OTHER; @@ -1723,10 +1719,6 @@ ocGetNames_ELF ( ObjectCode* oc ) char* zspace = stgCallocBytes(1, shdr[i].sh_size, "ocGetNames_ELF(anonymous bss)"); shdr[i].sh_offset = ((char*)zspace) - ((char*)ehdrC); - /* We don't prod BSS sections, hence the following isn't - necessary: - addProddableBlock(oc, zspace, shdr[i].sh_size); - */ /* fprintf(stderr, "BSS section at 0x%x, size %d\n", zspace, shdr[i].sh_size); @@ -1734,9 +1726,8 @@ ocGetNames_ELF ( ObjectCode* oc ) } /* fill in the section info */ - oc->sections[i].start = ehdrC + shdr[i].sh_offset; - oc->sections[i].end = ehdrC + shdr[i].sh_offset + shdr[i].sh_size - 1; - oc->sections[i].kind = kind; + addSection(oc, kind, ehdrC + shdr[i].sh_offset, + ehdrC + shdr[i].sh_offset + shdr[i].sh_size - 1); if (kind != SECTIONKIND_OTHER && shdr[i].sh_size > 0) addProddableBlock(oc, ehdrC + shdr[i].sh_offset, shdr[i].sh_size); @@ -1905,13 +1896,12 @@ do_Elf32_Rela_relocations ( ObjectCode* oc, char* ehdrC, for (j = 0; j < nent; j++) { Elf32_Addr offset = rtab[j].r_offset; Elf32_Word info = rtab[j].r_info; - Elf32_Sword addend = rtab[j].r_addend; - Elf32_Addr P = ((Elf32_Addr)targ) + offset; - Elf32_Addr A = addend; Elf32_Addr S; # if defined(sparc_TARGET_ARCH) /* This #ifdef only serves to avoid unused-var warnings. */ + Elf32_Sword addend = rtab[j].r_addend; + Elf32_Addr A = addend; Elf32_Word* pP = (Elf32_Word*)P; Elf32_Word w1, w2; # endif @@ -1949,7 +1939,7 @@ do_Elf32_Rela_relocations ( ObjectCode* oc, char* ehdrC, } IF_DEBUG(linker,fprintf ( stderr, "Reloc: P = %p S = %p A = %p\n", (void*)P, (void*)S, (void*)A )); - checkProddableBlock ( oc, P ); + checkProddableBlock ( oc, (void*)P ); switch (ELF32_R_TYPE(info)) { # if defined(sparc_TARGET_ARCH) case R_SPARC_WDISP30: