mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
Some additions for relocatable ppc dlls.
svn path=/branches/powerpc/; revision=25446
This commit is contained in:
@@ -375,6 +375,7 @@ typedef enum segframe_t {
|
||||
#define R_PPC_ADDR16_HI 5
|
||||
#define R_PPC_ADDR16_HA 6
|
||||
#define R_PPC_REL24 10
|
||||
#define R_PPC_PLTREL24 18
|
||||
#define R_PPC_UADDR32 24
|
||||
#define R_PPC_REL32 26
|
||||
#define R_PPC_SECTOFF 33
|
||||
@@ -397,6 +398,11 @@ typedef enum segframe_t {
|
||||
#define IMAGE_REL_PPC_SECRELLO 0x13
|
||||
#define IMAGE_REL_PPC_SECRELHI 0x14
|
||||
#define IMAGE_REL_PPC_GPREL 0x15
|
||||
#define IMAGE_REL_BASED_ABSOLUTE 0
|
||||
#define IMAGE_REL_BASED_HIGH 1
|
||||
#define IMAGE_REL_BASED_LOW 2
|
||||
#define IMAGE_REL_BASED_HIGHLOW 3
|
||||
#define IMAGE_REL_BASED_HIGHADJ 4
|
||||
|
||||
#define OUTPUT_COM 1
|
||||
#define OUTPUT_EXE 2
|
||||
|
||||
@@ -306,12 +306,22 @@ void loadelf(FILE *objfile)
|
||||
elf32sym.st_name);
|
||||
|
||||
#if 0
|
||||
const char *segname =
|
||||
elf32sym.st_shndx & 0x8000 ?
|
||||
"*SPC*" :
|
||||
(char *)
|
||||
(&stringList[0] +
|
||||
stringListOffsets[elf32hdr.e_shtrndx] +
|
||||
elf32shdr[elf32sym.st_shndx].sh_name);
|
||||
|
||||
fprintf(stderr,
|
||||
"S[%05x] value %08x size %08x info %08x "
|
||||
"other %08x shndx %08x %s\n",
|
||||
"other %08x shndx %08x (%-10s) %s\n",
|
||||
j,
|
||||
elf32sym.st_value, elf32sym.st_size, elf32sym.st_info,
|
||||
elf32sym.st_other, elf32sym.st_shndx, sym[j].name.c_str());
|
||||
elf32sym.st_other, elf32sym.st_shndx,
|
||||
segname,
|
||||
sym[j].name.c_str());
|
||||
#endif
|
||||
|
||||
if(!case_sensitive)
|
||||
@@ -608,6 +618,7 @@ void loadelf(FILE *objfile)
|
||||
reloc->rtype = FIX_PPC_ADDR24;
|
||||
break;
|
||||
|
||||
case R_PPC_PLTREL24:
|
||||
case R_PPC_REL24:
|
||||
reloc->rtype = FIX_PPC_REL24;
|
||||
break;
|
||||
|
||||
@@ -1216,6 +1216,9 @@ void BuildPERelocs(long relocSectNum,PUCHAR objectTable)
|
||||
case FIX_SELF_OFS16_2:
|
||||
case FIX_SELF_LBYTE:
|
||||
case FIX_RVA32:
|
||||
case FIX_REL32:
|
||||
case FIX_PPC_REL24:
|
||||
case FIX_PPC_SECTOFF:
|
||||
continue; /* self-relative fixups and RVA fixups don't relocate */
|
||||
default:
|
||||
break;
|
||||
@@ -1260,8 +1263,20 @@ void BuildPERelocs(long relocSectNum,PUCHAR objectTable)
|
||||
break;
|
||||
case FIX_PTR1632:
|
||||
case FIX_OFS32:
|
||||
case FIX_OFS32_2:
|
||||
case FIX_OFS32_2:
|
||||
j|= PE_REL_OFS32;
|
||||
|
||||
case FIX_ADDR32:
|
||||
j = (IMAGE_REL_BASED_HIGHLOW << 12) | (j & 0xfff);
|
||||
break;
|
||||
|
||||
case FIX_PPC_RVA16LO:
|
||||
j = (IMAGE_REL_BASED_LOW << 12) | (j & 0xfff);
|
||||
break;
|
||||
|
||||
case FIX_PPC_RVA16HA:
|
||||
j = (IMAGE_REL_BASED_HIGHADJ << 12) | (j & 0xfff);
|
||||
break;
|
||||
}
|
||||
/* store relocation */
|
||||
put16(relocSect->data, relocSect->length, j);
|
||||
@@ -2382,6 +2397,7 @@ void OutputWin32file(const std::string &outname)
|
||||
|
||||
for(i=0;i<outlist.size();i++)
|
||||
{
|
||||
fprintf(stderr, "Segment %08x: %s\n", outlist[i]->getbase(), outlist[i]->name.c_str());
|
||||
if(outlist[i] && ((outlist[i]->attr&SEG_ALIGN) !=SEG_ABS))
|
||||
{
|
||||
/* ensure section is aligned to file-Align */
|
||||
|
||||
Reference in New Issue
Block a user