Added files to build the PPC version. rldreloc.inc doesn't do anything
useful yet, though. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3137 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,63 @@
|
|||||||
|
OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
|
||||||
|
OUTPUT_ARCH(powerpc)
|
||||||
|
|
||||||
|
ENTRY(RLD_STARTUP)
|
||||||
|
SEARCH_DIR("libgcc");
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
. = 0x00100000 + SIZEOF_HEADERS;
|
||||||
|
|
||||||
|
.interp : { *(.interp) }
|
||||||
|
.hash : { *(.hash) }
|
||||||
|
.dynsym : { *(.dynsym) }
|
||||||
|
.dynstr : { *(.dynstr) }
|
||||||
|
.rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
|
||||||
|
.rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
|
||||||
|
.rel.data : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
|
||||||
|
.rela.data : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
|
||||||
|
.rel.rodata : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
|
||||||
|
.rela.rodata : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
|
||||||
|
.rel.got : { *(.rel.got) }
|
||||||
|
.rela.got : { *(.rela.got) }
|
||||||
|
.rel.ctors : { *(.rel.ctors) }
|
||||||
|
.rela.ctors : { *(.rela.ctors) }
|
||||||
|
.rel.dtors : { *(.rel.dtors) }
|
||||||
|
.rela.dtors : { *(.rela.dtors) }
|
||||||
|
.rel.init : { *(.rel.init) }
|
||||||
|
.rela.init : { *(.rela.init) }
|
||||||
|
.rel.fini : { *(.rel.fini) }
|
||||||
|
.rela.fini : { *(.rela.fini) }
|
||||||
|
.rel.bss : { *(.rel.bss) }
|
||||||
|
.rela.bss : { *(.rela.bss) }
|
||||||
|
.rel.plt : { *(.rel.plt) }
|
||||||
|
.rela.plt : { *(.rela.plt) }
|
||||||
|
.init : { *(.init) } =0x9090
|
||||||
|
.plt : { *(.plt) }
|
||||||
|
|
||||||
|
/* text/read-only data */
|
||||||
|
.text : { *(.text .gnu.linkonce.t.*) }
|
||||||
|
|
||||||
|
.rodata : { *(.rodata) }
|
||||||
|
|
||||||
|
/* writable data */
|
||||||
|
. = ALIGN(0x1000) + (. & (0x1000 - 1));
|
||||||
|
__data_start = .;
|
||||||
|
PROVIDE(_data_start = .);
|
||||||
|
.data : { *(.data .gnu.linkonce.d.*) }
|
||||||
|
|
||||||
|
__ctor_list = .;
|
||||||
|
PROVIDE (_ctor_list = .);
|
||||||
|
.ctors : { *(.ctors) }
|
||||||
|
PROVIDE (__ctor_end = .);
|
||||||
|
|
||||||
|
|
||||||
|
/* unintialized data (in same segment as writable data) */
|
||||||
|
PROVIDE (__bss_start = .);
|
||||||
|
.bss : { *(.bss) }
|
||||||
|
|
||||||
|
. = ALIGN(0x1000);
|
||||||
|
PROVIDE (_end = .);
|
||||||
|
|
||||||
|
/* Strip unnecessary stuff */
|
||||||
|
/DISCARD/ : { *(.comment .note .eh_frame .dtors) }
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
** Copyright 2003, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
|
** Distributed under the terms of the OpenBeOS License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
relocate_rel(image_t *image, struct Elf32_Rel *rel, int rel_len)
|
||||||
|
{
|
||||||
|
// ToDo: implement me!
|
||||||
|
|
||||||
|
return B_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static bool
|
||||||
|
relocate_image(image_t *image)
|
||||||
|
{
|
||||||
|
status_t status = B_NO_ERROR;
|
||||||
|
|
||||||
|
if (image->flags & RFLAG_RELOCATED)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
image->flags |= RFLAG_RELOCATED;
|
||||||
|
|
||||||
|
// deal with the rels first
|
||||||
|
if (image->rel) {
|
||||||
|
status = relocate_rel(image, image->rel, image->rel_len);
|
||||||
|
if (status)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (image->pltrel) {
|
||||||
|
status = relocate_rel(image, image->pltrel, image->pltrel_len);
|
||||||
|
if (status)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (image->rela) {
|
||||||
|
//int i;
|
||||||
|
printf("RELA relocations not supported\n");
|
||||||
|
return false;
|
||||||
|
|
||||||
|
//for (i = 1; i * (int)sizeof(struct Elf32_Rela) < image->rela_len; i++) {
|
||||||
|
// printf("rela: type %d\n", ELF32_R_TYPE(image->rela[i].r_info));
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user