bitkeeper revision 1.1062.1.7 (40f24af2r5kZAs1cqmBvB4wRz47kpg)

Fix the linker scripts to always produce exactly one loadable program
segment.
This commit is contained in:
kaf24@scramble.cl.cam.ac.uk committed 2004-07-12 08:25:22 +00:00
1 parent bae5520a0b
commit 97a265d188
3 files changed
+57 -33

No files matched your search

+14
View File
@@ -199,6 +199,13 @@ int main(int argc, char **argv)
return 1;
}
if ( in32_ehdr.e_phnum != 1 )
{
fprintf(stderr, "Expect precisly 1 program header; found %d.\n",
(int)in32_ehdr.e_phnum);
return 1;
}
(void)lseek(infd, in32_ehdr.e_phoff, SEEK_SET);
do_read(infd, &in32_phdr, sizeof(in32_phdr));
@@ -218,6 +225,13 @@ int main(int argc, char **argv)
return 1;
}
if ( in64_ehdr.e_phnum != 1 )
{
fprintf(stderr, "Expect precisly 1 program header; found %d.\n",
(int)in64_ehdr.e_phnum);
return 1;
}
(void)lseek(infd, in64_ehdr.e_phoff, SEEK_SET);
do_read(infd, &in64_phdr, sizeof(in64_phdr));
+22 -17
View File
@@ -1,9 +1,14 @@
/* ld script to make i386 Linux kernel
* Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
* Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
* Modifified for i386 Xen by Keir Fraser
*/
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(start)
PHDRS
{
text PT_LOAD ;
}
SECTIONS
{
. = 0xFC400000 + 0x100000;
@@ -12,61 +17,61 @@ SECTIONS
*(.text)
*(.fixup)
*(.gnu.warning)
} = 0x9090
.text.lock : { *(.text.lock) } /* out-of-line lock text */
} :text =0x9090
.text.lock : { *(.text.lock) } :text /* out-of-line lock text */
_etext = .; /* End of text section */
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
.rodata : { *(.rodata) *(.rodata.*) } :text
.kstrtab : { *(.kstrtab) } :text
. = ALIGN(16); /* Exception table */
__start___ex_table = .;
__ex_table : { *(__ex_table) }
__ex_table : { *(__ex_table) } :text
__stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__ksymtab : { *(__ksymtab) } :text
__stop___ksymtab = .;
__start___kallsyms = .; /* All kernel symbols */
__kallsyms : { *(__kallsyms) }
__kallsyms : { *(__kallsyms) } :text
__stop___kallsyms = .;
.data : { /* Data */
*(.data)
CONSTRUCTORS
}
} :text
_edata = .; /* End of data section */
. = ALIGN(8192); /* init_task */
.data.init_task : { *(.data.init_task) }
.data.init_task : { *(.data.init_task) } :text
. = ALIGN(4096); /* Init code and data */
__init_begin = .;
.text.init : { *(.text.init) }
.data.init : { *(.data.init) }
.text.init : { *(.text.init) } :text
.data.init : { *(.data.init) } :text
. = ALIGN(16);
__setup_start = .;
.setup.init : { *(.setup.init) }
.setup.init : { *(.setup.init) } :text
__setup_end = .;
__initcall_start = .;
.initcall.init : { *(.initcall.init) }
.initcall.init : { *(.initcall.init) } :text
__initcall_end = .;
. = ALIGN(4096);
__init_end = .;
. = ALIGN(4096);
.data.page_aligned : { *(.data.idt) }
.data.page_aligned : { *(.data.idt) } :text
. = ALIGN(32);
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
.data.cacheline_aligned : { *(.data.cacheline_aligned) } :text
__bss_start = .; /* BSS */
.bss : {
*(.bss)
}
} :text
_end = . ;
/* Sections to be discarded */
+21 -16
View File
@@ -1,7 +1,12 @@
/* Excerpts written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> */
/* Modified for x86-64 Xen by Keir Fraser */
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)
ENTRY(start)
PHDRS
{
text PT_LOAD ;
}
SECTIONS
{
. = 0xFFFF830000100000;
@@ -10,61 +15,61 @@ SECTIONS
*(.text)
*(.fixup)
*(.gnu.warning)
} = 0x9090
.text.lock : { *(.text.lock) } /* out-of-line lock text */
} :text = 0x9090
.text.lock : { *(.text.lock) } :text /* out-of-line lock text */
_etext = .; /* End of text section */
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
.rodata : { *(.rodata) *(.rodata.*) } :text
.kstrtab : { *(.kstrtab) } :text
. = ALIGN(16); /* Exception table */
__start___ex_table = .;
__ex_table : { *(__ex_table) }
__ex_table : { *(__ex_table) } :text
__stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__ksymtab : { *(__ksymtab) } :text
__stop___ksymtab = .;
__start___kallsyms = .; /* All kernel symbols */
__kallsyms : { *(__kallsyms) }
__kallsyms : { *(__kallsyms) } :text
__stop___kallsyms = .;
.data : { /* Data */
*(.data)
CONSTRUCTORS
}
} :text
_edata = .; /* End of data section */
. = ALIGN(8192); /* init_task */
.data.init_task : { *(.data.init_task) }
.data.init_task : { *(.data.init_task) } :text
. = ALIGN(4096); /* Init code and data */
__init_begin = .;
.text.init : { *(.text.init) }
.data.init : { *(.data.init) }
.text.init : { *(.text.init) } :text
.data.init : { *(.data.init) } :text
. = ALIGN(16);
__setup_start = .;
.setup.init : { *(.setup.init) }
.setup.init : { *(.setup.init) } :text
__setup_end = .;
__initcall_start = .;
.initcall.init : { *(.initcall.init) }
.initcall.init : { *(.initcall.init) } :text
__initcall_end = .;
. = ALIGN(4096);
__init_end = .;
. = ALIGN(4096);
.data.page_aligned : { *(.data.idt) }
.data.page_aligned : { *(.data.idt) } :text
. = ALIGN(32);
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
.data.cacheline_aligned : { *(.data.cacheline_aligned) } :text
__bss_start = .; /* BSS */
.bss : {
*(.bss)
}
} :text
_end = . ;
/* Sections to be discarded */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.