aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2016-02-09 18:05:48 -0800
committerH. Peter Anvin <hpa@zytor.com>2016-02-09 18:05:48 -0800
commit72d2959272b4616f17a97667e6dfa9d06bf109a3 (patch)
tree076a32c42e768b7d75de0027f9463b843f5b4f57
parent7cd1ed60e37f36db859a2ca3d6ee261f98dafdac (diff)
downloadsyslinux-72d2959272b4616f17a97667e6dfa9d06bf109a3.tar.gz
syslinux-72d2959272b4616f17a97667e6dfa9d06bf109a3.tar.xz
syslinux-72d2959272b4616f17a97667e6dfa9d06bf109a3.zip
Delete unused files
Remove several files which aren't used at all during the build. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--com32/tools/Makefile7
-rw-r--r--com32/tools/relocs.c808
-rw-r--r--core/syslinux.ld414
-rw-r--r--core/x86_64/syslinux.ld389
-rw-r--r--mk/com32.mk1
5 files changed, 2 insertions, 1617 deletions
diff --git a/com32/tools/Makefile b/com32/tools/Makefile
index 9c0ea708..d64fc1d9 100644
--- a/com32/tools/Makefile
+++ b/com32/tools/Makefile
@@ -1,6 +1,6 @@
## -*- makefile -*- ------------------------------------------------------
##
-## Copyright 2001-2008 H. Peter Anvin - All Rights Reserved
+## Copyright 2001-2016 H. Peter Anvin - All Rights Reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -13,15 +13,12 @@
VPATH = $(SRC)
include $(MAKEDIR)/build.mk
-BINS = relocs
+BINS =
INCLUDES += -I$(SRC)/include
all : $(BINS)
-relocs : relocs.o
- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
-
tidy dist clean spotless:
rm -f $(BINS)
rm -f *.o *.a .*.d
diff --git a/com32/tools/relocs.c b/com32/tools/relocs.c
deleted file mode 100644
index 86fc7c50..00000000
--- a/com32/tools/relocs.c
+++ /dev/null
@@ -1,808 +0,0 @@
-/*
- * This file is taken from the Linux kernel and is distributed under GPL v2.
- */
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <elf.h>
-#include <byteswap.h>
-#define USE_BSD
-#include <endian.h>
-#include <regex.h>
-#include <tools/le_byteshift.h>
-
-static void die(char *fmt, ...);
-
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-static Elf32_Ehdr ehdr;
-static unsigned long reloc_count, reloc_idx;
-static unsigned long *relocs;
-static unsigned long reloc16_count, reloc16_idx;
-static unsigned long *relocs16;
-
-struct section {
- Elf32_Shdr shdr;
- struct section *link;
- Elf32_Sym *symtab;
- Elf32_Rel *reltab;
- char *strtab;
-};
-static struct section *secs;
-
-enum symtype {
- S_ABS,
- S_REL,
- S_SEG,
- S_LIN,
- S_NSYMTYPES
-};
-
-static const char * const sym_regex_kernel[S_NSYMTYPES] = {
-/*
- * Following symbols have been audited. Don't warn user about
- * absolute relocations present w.r.t these symbols.
- */
- [S_ABS] =
- "^(__.*_len|__.*_dwords)$",
-
-/*
- * These symbols are known to be relative, even if the linker marks them
- * as absolute (typically defined outside any section in the linker script.)
- */
- [S_REL] =
- "^(__.*_start|__.*_end|_end|_[se](text|data))$",
-};
-
-
-static const char * const sym_regex_realmode[S_NSYMTYPES] = {
-/*
- * These are 16-bit segment symbols when compiling 16-bit code.
- */
- [S_SEG] =
- "^real_mode_seg$",
-
-/*
- * These are offsets belonging to segments, as opposed to linear addresses,
- * when compiling 16-bit code.
- */
- [S_LIN] =
- "^pa_",
-};
-
-static const char * const *sym_regex;
-
-static regex_t sym_regex_c[S_NSYMTYPES];
-static int is_reloc(enum symtype type, const char *sym_name)
-{
- return sym_regex[type] &&
- !regexec(&sym_regex_c[type], sym_name, 0, NULL, 0);
-}
-
-static void regex_init(int use_real_mode)
-{
- char errbuf[128];
- int err;
- int i;
-
- if (use_real_mode)
- sym_regex = sym_regex_realmode;
- else
- sym_regex = sym_regex_kernel;
-
- for (i = 0; i < S_NSYMTYPES; i++) {
- if (!sym_regex[i])
- continue;
-
- err = regcomp(&sym_regex_c[i], sym_regex[i],
- REG_EXTENDED|REG_NOSUB);
-
- if (err) {
- regerror(err, &sym_regex_c[i], errbuf, sizeof errbuf);
- die("%s", errbuf);
- }
- }
-}
-
-static void die(char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
- va_end(ap);
- exit(1);
-}
-
-static const char *sym_type(unsigned type)
-{
- static const char *type_name[] = {
-#define SYM_TYPE(X) [X] = #X
- SYM_TYPE(STT_NOTYPE),
- SYM_TYPE(STT_OBJECT),
- SYM_TYPE(STT_FUNC),
- SYM_TYPE(STT_SECTION),
- SYM_TYPE(STT_FILE),
- SYM_TYPE(STT_COMMON),
- SYM_TYPE(STT_TLS),
-#undef SYM_TYPE
- };
- const char *name = "unknown sym type name";
- if (type < ARRAY_SIZE(type_name)) {
- name = type_name[type];
- }
- return name;
-}
-
-static const char *sym_bind(unsigned bind)
-{
- static const char *bind_name[] = {
-#define SYM_BIND(X) [X] = #X
- SYM_BIND(STB_LOCAL),
- SYM_BIND(STB_GLOBAL),
- SYM_BIND(STB_WEAK),
-#undef SYM_BIND
- };
- const char *name = "unknown sym bind name";
- if (bind < ARRAY_SIZE(bind_name)) {
- name = bind_name[bind];
- }
- return name;
-}
-
-static const char *sym_visibility(unsigned visibility)
-{
- static const char *visibility_name[] = {
-#define SYM_VISIBILITY(X) [X] = #X
- SYM_VISIBILITY(STV_DEFAULT),
- SYM_VISIBILITY(STV_INTERNAL),
- SYM_VISIBILITY(STV_HIDDEN),
- SYM_VISIBILITY(STV_PROTECTED),
-#undef SYM_VISIBILITY
- };
- const char *name = "unknown sym visibility name";
- if (visibility < ARRAY_SIZE(visibility_name)) {
- name = visibility_name[visibility];
- }
- return name;
-}
-
-static const char *rel_type(unsigned type)
-{
- static const char *type_name[] = {
-#define REL_TYPE(X) [X] = #X
- REL_TYPE(R_386_NONE),
- REL_TYPE(R_386_32),
- REL_TYPE(R_386_PC32),
- REL_TYPE(R_386_GOT32),
- REL_TYPE(R_386_PLT32),
- REL_TYPE(R_386_COPY),
- REL_TYPE(R_386_GLOB_DAT),
- REL_TYPE(R_386_JMP_SLOT),
- REL_TYPE(R_386_RELATIVE),
- REL_TYPE(R_386_GOTOFF),
- REL_TYPE(R_386_GOTPC),
- REL_TYPE(R_386_8),
- REL_TYPE(R_386_PC8),
- REL_TYPE(R_386_16),
- REL_TYPE(R_386_PC16),
-#undef REL_TYPE
- };
- const char *name = "unknown type rel type name";
- if (type < ARRAY_SIZE(type_name) && type_name[type]) {
- name = type_name[type];
- }
- return name;
-}
-
-static const char *sec_name(unsigned shndx)
-{
- const char *sec_strtab;
- const char *name;
- sec_strtab = secs[ehdr.e_shstrndx].strtab;
- name = "<noname>";
- if (shndx < ehdr.e_shnum) {
- name = sec_strtab + secs[shndx].shdr.sh_name;
- }
- else if (shndx == SHN_ABS) {
- name = "ABSOLUTE";
- }
- else if (shndx == SHN_COMMON) {
- name = "COMMON";
- }
- return name;
-}
-
-static const char *sym_name(const char *sym_strtab, Elf32_Sym *sym)
-{
- const char *name;
- name = "<noname>";
- if (sym->st_name) {
- name = sym_strtab + sym->st_name;
- }
- else {
- name = sec_name(sym->st_shndx);
- }
- return name;
-}
-
-
-
-#if BYTE_ORDER == LITTLE_ENDIAN
-#define le16_to_cpu(val) (val)
-#define le32_to_cpu(val) (val)
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
-#define le16_to_cpu(val) bswap_16(val)
-#define le32_to_cpu(val) bswap_32(val)
-#endif
-
-static uint16_t elf16_to_cpu(uint16_t val)
-{
- return le16_to_cpu(val);
-}
-
-static uint32_t elf32_to_cpu(uint32_t val)
-{
- return le32_to_cpu(val);
-}
-
-static void read_ehdr(FILE *fp)
-{
- if (fread(&ehdr, sizeof(ehdr), 1, fp) != 1) {
- die("Cannot read ELF header: %s\n",
- strerror(errno));
- }
- if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0) {
- die("No ELF magic\n");
- }
- if (ehdr.e_ident[EI_CLASS] != ELFCLASS32) {
- die("Not a 32 bit executable\n");
- }
- if (ehdr.e_ident[EI_DATA] != ELFDATA2LSB) {
- die("Not a LSB ELF executable\n");
- }
- if (ehdr.e_ident[EI_VERSION] != EV_CURRENT) {
- die("Unknown ELF version\n");
- }
- /* Convert the fields to native endian */
- ehdr.e_type = elf16_to_cpu(ehdr.e_type);
- ehdr.e_machine = elf16_to_cpu(ehdr.e_machine);
- ehdr.e_version = elf32_to_cpu(ehdr.e_version);
- ehdr.e_entry = elf32_to_cpu(ehdr.e_entry);
- ehdr.e_phoff = elf32_to_cpu(ehdr.e_phoff);
- ehdr.e_shoff = elf32_to_cpu(ehdr.e_shoff);
- ehdr.e_flags = elf32_to_cpu(ehdr.e_flags);
- ehdr.e_ehsize = elf16_to_cpu(ehdr.e_ehsize);
- ehdr.e_phentsize = elf16_to_cpu(ehdr.e_phentsize);
- ehdr.e_phnum = elf16_to_cpu(ehdr.e_phnum);
- ehdr.e_shentsize = elf16_to_cpu(ehdr.e_shentsize);
- ehdr.e_shnum = elf16_to_cpu(ehdr.e_shnum);
- ehdr.e_shstrndx = elf16_to_cpu(ehdr.e_shstrndx);
-
- if ((ehdr.e_type != ET_EXEC) && (ehdr.e_type != ET_DYN)) {
- die("Unsupported ELF header type\n");
- }
- if (ehdr.e_machine != EM_386) {
- die("Not for x86\n");
- }
- if (ehdr.e_version != EV_CURRENT) {
- die("Unknown ELF version\n");
- }
- if (ehdr.e_ehsize != sizeof(Elf32_Ehdr)) {
- die("Bad Elf header size\n");
- }
- if (ehdr.e_phentsize != sizeof(Elf32_Phdr)) {
- die("Bad program header entry\n");
- }
- if (ehdr.e_shentsize != sizeof(Elf32_Shdr)) {
- die("Bad section header entry\n");
- }
- if (ehdr.e_shstrndx >= ehdr.e_shnum) {
- die("String table index out of bounds\n");
- }
-}
-
-static void read_shdrs(FILE *fp)
-{
- int i;
- Elf32_Shdr shdr;
-
- secs = calloc(ehdr.e_shnum, sizeof(struct section));
- if (!secs) {
- die("Unable to allocate %d section headers\n",
- ehdr.e_shnum);
- }
- if (fseek(fp, ehdr.e_shoff, SEEK_SET) < 0) {
- die("Seek to %d failed: %s\n",
- ehdr.e_shoff, strerror(errno));
- }
- for (i = 0; i < ehdr.e_shnum; i++) {
- struct section *sec = &secs[i];
- if (fread(&shdr, sizeof shdr, 1, fp) != 1)
- die("Cannot read ELF section headers %d/%d: %s\n",
- i, ehdr.e_shnum, strerror(errno));
- sec->shdr.sh_name = elf32_to_cpu(shdr.sh_name);
- sec->shdr.sh_type = elf32_to_cpu(shdr.sh_type);
- sec->shdr.sh_flags = elf32_to_cpu(shdr.sh_flags);
- sec->shdr.sh_addr = elf32_to_cpu(shdr.sh_addr);
- sec->shdr.sh_offset = elf32_to_cpu(shdr.sh_offset);
- sec->shdr.sh_size = elf32_to_cpu(shdr.sh_size);
- sec->shdr.sh_link = elf32_to_cpu(shdr.sh_link);
- sec->shdr.sh_info = elf32_to_cpu(shdr.sh_info);
- sec->shdr.sh_addralign = elf32_to_cpu(shdr.sh_addralign);
- sec->shdr.sh_entsize = elf32_to_cpu(shdr.sh_entsize);
- if (sec->shdr.sh_link < ehdr.e_shnum)
- sec->link = &secs[sec->shdr.sh_link];
- }
-
-}
-
-static void read_strtabs(FILE *fp)
-{
- int i;
- for (i = 0; i < ehdr.e_shnum; i++) {
- struct section *sec = &secs[i];
- if (sec->shdr.sh_type != SHT_STRTAB) {
- continue;
- }
- sec->strtab = malloc(sec->shdr.sh_size);
- if (!sec->strtab) {
- die("malloc of %d bytes for strtab failed\n",
- sec->shdr.sh_size);
- }
- if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) {
- die("Seek to %d failed: %s\n",
- sec->shdr.sh_offset, strerror(errno));
- }
- if (fread(sec->strtab, 1, sec->shdr.sh_size, fp)
- != sec->shdr.sh_size) {
- die("Cannot read symbol table: %s\n",
- strerror(errno));
- }
- }
-}
-
-static void read_symtabs(FILE *fp)
-{
- int i,j;
- for (i = 0; i < ehdr.e_shnum; i++) {
- struct section *sec = &secs[i];
- if (sec->shdr.sh_type != SHT_SYMTAB) {
- continue;
- }
- sec->symtab = malloc(sec->shdr.sh_size);
- if (!sec->symtab) {
- die("malloc of %d bytes for symtab failed\n",
- sec->shdr.sh_size);
- }
- if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) {
- die("Seek to %d failed: %s\n",
- sec->shdr.sh_offset, strerror(errno));
- }
- if (fread(sec->symtab, 1, sec->shdr.sh_size, fp)
- != sec->shdr.sh_size) {
- die("Cannot read symbol table: %s\n",
- strerror(errno));
- }
- for (j = 0; j < sec->shdr.sh_size/sizeof(Elf32_Sym); j++) {
- Elf32_Sym *sym = &sec->symtab[j];
- sym->st_name = elf32_to_cpu(sym->st_name);
- sym->st_value = elf32_to_cpu(sym->st_value);
- sym->st_size = elf32_to_cpu(sym->st_size);
- sym->st_shndx = elf16_to_cpu(sym->st_shndx);
- }
- }
-}
-
-
-static void read_relocs(FILE *fp)
-{
- int i,j;
- for (i = 0; i < ehdr.e_shnum; i++) {
- struct section *sec = &secs[i];
- if (sec->shdr.sh_type != SHT_REL) {
- continue;
- }
- sec->reltab = malloc(sec->shdr.sh_size);
- if (!sec->reltab) {
- die("malloc of %d bytes for relocs failed\n",
- sec->shdr.sh_size);
- }
- if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) {
- die("Seek to %d failed: %s\n",
- sec->shdr.sh_offset, strerror(errno));
- }
- if (fread(sec->reltab, 1, sec->shdr.sh_size, fp)
- != sec->shdr.sh_size) {
- die("Cannot read symbol table: %s\n",
- strerror(errno));
- }
- for (j = 0; j < sec->shdr.sh_size/sizeof(Elf32_Rel); j++) {
- Elf32_Rel *rel = &sec->reltab[j];
- rel->r_offset = elf32_to_cpu(rel->r_offset);
- rel->r_info = elf32_to_cpu(rel->r_info);
- }
- }
-}
-
-
-static void print_absolute_symbols(void)
-{
- int i;
- printf("Absolute symbols\n");
- printf(" Num: Value Size Type Bind Visibility Name\n");
- for (i = 0; i < ehdr.e_shnum; i++) {
- struct section *sec = &secs[i];
- char *sym_strtab;
- int j;
-
- if (sec->shdr.sh_type != SHT_SYMTAB) {
- continue;
- }
- sym_strtab = sec->link->strtab;
- for (j = 0; j < sec->shdr.sh_size/sizeof(Elf32_Sym); j++) {
- Elf32_Sym *sym;
- const char *name;
- sym = &sec->symtab[j];
- name = sym_name(sym_strtab, sym);
- if (sym->st_shndx != SHN_ABS) {
- continue;
- }
- printf("%5d %08x %5d %10s %10s %12s %s\n",
- j, sym->st_value, sym->st_size,
- sym_type(ELF32_ST_TYPE(sym->st_info)),
- sym_bind(ELF32_ST_BIND(sym->st_info)),
- sym_visibility(ELF32_ST_VISIBILITY(sym->st_other)),
- name);
- }
- }
- printf("\n");
-}
-
-static void print_absolute_relocs(void)
-{
- int i, printed = 0;
-
- for (i = 0; i < ehdr.e_shnum; i++) {
- struct section *sec = &secs[i];
- struct section *sec_applies, *sec_symtab;
- char *sym_strtab;
- Elf32_Sym *sh_symtab;
- int j;
- if (sec->shdr.sh_type != SHT_REL) {
- continue;
- }
- sec_symtab = sec->link;
- sec_applies = &secs[sec->shdr.sh_info];
- if (!(sec_applies->shdr.sh_flags & SHF_ALLOC)) {
- continue;
- }
- sh_symtab = sec_symtab->symtab;
- sym_strtab = sec_symtab->link->strtab;
- for (j = 0; j < sec->shdr.sh_size/sizeof(Elf32_Rel); j++) {
- Elf32_Rel *rel;
- Elf32_Sym *sym;
- const char *name;
- rel = &sec->reltab[j];
- sym = &sh_symtab[ELF32_R_SYM(rel->r_info)];
- name = sym_name(sym_strtab, sym);
- if (sym->st_shndx != SHN_ABS) {
- continue;
- }
-
- /* Absolute symbols are not relocated if bzImage is
- * loaded at a non-compiled address. Display a warning
- * to user at compile time about the absolute
- * relocations present.
- *
- * User need to audit the code to make sure
- * some symbols which should have been section
- * relative have not become absolute because of some
- * linker optimization or wrong programming usage.
- *
- * Before warning check if this absolute symbol
- * relocation is harmless.
- */
- if (is_reloc(S_ABS, name) || is_reloc(S_REL, name))
- continue;
-
- if (!printed) {
- printf("WARNING: Absolute relocations"
- " present\n");
- printf("Offset Info Type Sym.Value "
- "Sym.Name\n");
- printed = 1;
- }
-
- printf("%08x %08x %10s %08x %s\n",
- rel->r_offset,
- rel->r_info,
- rel_type(ELF32_R_TYPE(rel->r_info)),
- sym->st_value,
- name);
- }
- }
-
- if (printed)
- printf("\n");
-}
-
-static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym),
- int use_real_mode)
-{
- int i;
- /* Walk through the relocations */
- for (i = 0; i < ehdr.e_shnum; i++) {
- char *sym_strtab;
- Elf32_Sym *sh_symtab;
- struct section *sec_applies, *sec_symtab;
- int j;
- struct section *sec = &secs[i];
-
- if (sec->shdr.sh_type != SHT_REL) {
- continue;
- }
- sec_symtab = sec->link;
- sec_applies = &secs[sec->shdr.sh_info];
- if (!(sec_applies->shdr.sh_flags & SHF_ALLOC)) {
- continue;
- }
- sh_symtab = sec_symtab->symtab;
- sym_strtab = sec_symtab->link->strtab;
- for (j = 0; j < sec->shdr.sh_size/sizeof(Elf32_Rel); j++) {
- Elf32_Rel *rel;
- Elf32_Sym *sym;
- unsigned r_type;
- const char *symname;
- int shn_abs;
-
- rel = &sec->reltab[j];
- sym = &sh_symtab[ELF32_R_SYM(rel->r_info)];
- r_type = ELF32_R_TYPE(rel->r_info);
-
- shn_abs = sym->st_shndx == SHN_ABS;
-
- switch (r_type) {
- case R_386_NONE:
- case R_386_PC32:
- case R_386_PC16:
- case R_386_PC8:
- case R_386_GOTPC:
- case R_386_GOTOFF:
- case R_386_GOT32:
- case R_386_PLT32:
- /*
- * NONE can be ignored and and PC relative
- * relocations don't need to be adjusted.
- */
- break;
-
- case R_386_16:
- symname = sym_name(sym_strtab, sym);
- if (!use_real_mode)
- goto bad;
- if (shn_abs) {
- if (is_reloc(S_ABS, symname))
- break;
- else if (!is_reloc(S_SEG, symname))
- goto bad;
- } else {
- if (is_reloc(S_LIN, symname))
- goto bad;
- else
- break;
- }
- visit(rel, sym);
- break;
-
- case R_386_32:
- symname = sym_name(sym_strtab, sym);
- if (shn_abs) {
- if (is_reloc(S_ABS, symname))
- break;
- else if (!is_reloc(S_REL, symname))
- goto bad;
- } else {
- if (use_real_mode &&
- !is_reloc(S_LIN, symname))
- break;
- }
- visit(rel, sym);
- break;
- default:
- die("Unsupported relocation type: %s (%d)\n",
- rel_type(r_type), r_type);
- break;
- bad:
- symname = sym_name(sym_strtab, sym);
- die("Invalid %s %s relocation: %s\n",
- shn_abs ? "absolute" : "relative",
- rel_type(r_type), symname);
- }
- }
- }
-}
-
-static void count_reloc(Elf32_Rel *rel, Elf32_Sym *sym)
-{
- (void)sym;
-
- if (ELF32_R_TYPE(rel->r_info) == R_386_16)
- reloc16_count++;
- else
- reloc_count++;
-}
-
-static void collect_reloc(Elf32_Rel *rel, Elf32_Sym *sym)
-{
- (void)sym;
-
- /* Remember the address that needs to be adjusted. */
- if (ELF32_R_TYPE(rel->r_info) == R_386_16)
- relocs16[reloc16_idx++] = rel->r_offset;
- else
- relocs[reloc_idx++] = rel->r_offset;
-}
-
-static int cmp_relocs(const void *va, const void *vb)
-{
- const unsigned long *a, *b;
- a = va; b = vb;
- return (*a == *b)? 0 : (*a > *b)? 1 : -1;
-}
-
-static int write32(unsigned int v, FILE *f)
-{
- unsigned char buf[4];
-
- put_unaligned_le32(v, buf);
- return fwrite(buf, 1, 4, f) == 4 ? 0 : -1;
-}
-
-static void emit_relocs(int as_text, int use_real_mode)
-{
- int i;
- /* Count how many relocations I have and allocate space for them. */
- reloc_count = 0;
- walk_relocs(count_reloc, use_real_mode);
- relocs = malloc(reloc_count * sizeof(relocs[0]));
- if (!relocs) {
- die("malloc of %d entries for relocs failed\n",
- reloc_count);
- }
-
- relocs16 = malloc(reloc16_count * sizeof(relocs[0]));
- if (!relocs16) {
- die("malloc of %d entries for relocs16 failed\n",
- reloc16_count);
- }
- /* Collect up the relocations */
- reloc_idx = 0;
- walk_relocs(collect_reloc, use_real_mode);
-
- if (reloc16_count && !use_real_mode)
- die("Segment relocations found but --realmode not specified\n");
-
- /* Order the relocations for more efficient processing */
- qsort(relocs, reloc_count, sizeof(relocs[0]), cmp_relocs);
- qsort(relocs16, reloc16_count, sizeof(relocs16[0]), cmp_relocs);
-
- /* Print the relocations */
- if (as_text) {
- /* Print the relocations in a form suitable that
- * gas will like.
- */
- printf(".section \".data.reloc\",\"a\"\n");
- printf(".balign 4\n");
- if (use_real_mode) {
- printf("\t.long %lu\n", reloc16_count);
- for (i = 0; i < reloc16_count; i++)
- printf("\t.long 0x%08lx\n", relocs16[i]);
- printf("\t.long %lu\n", reloc_count);
- for (i = 0; i < reloc_count; i++) {
- printf("\t.long 0x%08lx\n", relocs[i]);
- }
- } else {
- for (i = 0; i < reloc_count; i++) {
- printf("\t.long 0x%08lx\n", relocs[i]);
- }
- /* Print a stop */
- printf("\t.long 0x%08lx\n", (unsigned long)0);
- }
-
- printf("\n");
- }
- else {
- if (use_real_mode) {
- write32(reloc16_count, stdout);
- for (i = 0; i < reloc16_count; i++)
- write32(relocs16[i], stdout);
- write32(reloc_count, stdout);
-
- /* Now print each relocation */
- for (i = 0; i < reloc_count; i++)
- write32(relocs[i], stdout);
- } else {
- /* Now print each relocation */
- for (i = 0; i < reloc_count; i++) {
- write32(relocs[i], stdout);
- }
-
- /* Print a stop */
- write32(0, stdout);
- }
- }
-}
-
-static void usage(void)
-{
- die("relocs [--abs-syms|--abs-relocs|--text|--realmode] vmlinux\n");
-}
-
-int main(int argc, char **argv)
-{
- int show_absolute_syms, show_absolute_relocs;
- int as_text, use_real_mode;
- const char *fname;
- FILE *fp;
- int i;
-
- show_absolute_syms = 0;
- show_absolute_relocs = 0;
- as_text = 0;
- use_real_mode = 0;
- fname = NULL;
- for (i = 1; i < argc; i++) {
- char *arg = argv[i];
- if (*arg == '-') {
- if (strcmp(arg, "--abs-syms") == 0) {
- show_absolute_syms = 1;
- continue;
- }
- if (strcmp(arg, "--abs-relocs") == 0) {
- show_absolute_relocs = 1;
- continue;
- }
- if (strcmp(arg, "--text") == 0) {
- as_text = 1;
- continue;
- }
- if (strcmp(arg, "--realmode") == 0) {
- use_real_mode = 1;
- continue;
- }
- }
- else if (!fname) {
- fname = arg;
- continue;
- }
- usage();
- }
- if (!fname) {
- usage();
- }
- regex_init(use_real_mode);
- fp = fopen(fname, "r");
- if (!fp) {
- die("Cannot open %s: %s\n",
- fname, strerror(errno));
- }
- read_ehdr(fp);
- read_shdrs(fp);
- read_strtabs(fp);
- read_symtabs(fp);
- read_relocs(fp);
- if (show_absolute_syms) {
- print_absolute_symbols();
- return 0;
- }
- if (show_absolute_relocs) {
- print_absolute_relocs();
- return 0;
- }
- emit_relocs(as_text, use_real_mode);
- return 0;
-}
diff --git a/core/syslinux.ld b/core/syslinux.ld
deleted file mode 100644
index fa8c8c9b..00000000
--- a/core/syslinux.ld
+++ /dev/null
@@ -1,414 +0,0 @@
-/* -----------------------------------------------------------------------
- *
- * Copyright 2008-2009 H. Peter Anvin - All Rights Reserved
- * Copyright 2009 Intel Corporation; author: H. Peter Anvin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston MA 02110-1301, USA; either version 2 of the License, or
- * (at your option) any later version; incorporated herein by reference.
- *
- * ----------------------------------------------------------------------- */
-
-/*
- * Linker script for the SYSLINUX core
- */
-
-OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
-OUTPUT_ARCH(i386)
-EXTERN(_start)
-ENTRY(_start)
-
-STACK32_LEN = 65536;
-
-SECTIONS
-{
- /* Prefix structure for the compression program */
- . = 0;
- HIDDEN(__module_start = .);
- .prefix : {
- *(.prefix)
- }
-
- /* "Early" sections (before the load) */
- . = 0x1000;
-
- .earlybss (NOLOAD) : {
- HIDDEN(__earlybss_start = .);
- *(.earlybss)
- HIDDEN(__earlybss_end = .);
- }
- HIDDEN(__earlybss_len = ABSOLUTE(__earlybss_end) - ABSOLUTE(__earlybss_start));
- HIDDEN(__earlybss_dwords = (__earlybss_len + 3) >> 2);
-
- . = ALIGN(4);
- .bss16 (NOLOAD) : {
- HIDDEN(__bss16_start = .);
- *(.bss16)
- HIDDEN(__bss16_end = .);
- }
- HIDDEN(__bss16_len = ABSOLUTE(__bss16_end) - ABSOLUTE(__bss16_start));
- HIDDEN(__bss16_dwords = (__bss16_len + 3) >> 2);
-
- . = ALIGN(4);
- .config : AT (__config_lma) {
- HIDDEN(__config_start = .);
- *(.config)
- HIDDEN(__config_end = .);
- }
- HIDDEN(__config_len = ABSOLUTE(__config_end) - ABSOLUTE(__config_start));
- HIDDEN(__config_dwords = (__config_len + 3) >> 2);
-
- /* Generated and/or copied code */
-
- . = ALIGN(128); /* Minimum separation from mutable data */
- .replacestub : AT (__replacestub_lma) {
- HIDDEN(__replacestub_start = .);
- *(.replacestub)
- HIDDEN(__replacestub_end = .);
- }
- HIDDEN(__replacestub_len = ABSOLUTE(__replacestub_end) - ABSOLUTE(__replacestub_start));
- HIDDEN(__replacestub_dwords = (__replacestub_len + 3) >> 2);
-
- . = ALIGN(16);
- HIDDEN(__gentextnr_lma = .);
- .gentextnr : AT(__gentextnr_lma) {
- HIDDEN(__gentextnr_start = .);
- *(.gentextnr)
- HIDDEN(__gentextnr_end = .);
- }
- HIDDEN(__gentextnr_len = ABSOLUTE(__gentextnr_end) - ABSOLUTE(__gentextnr_start));
- HIDDEN(__gentextnr_dwords = (__gentextnr_len + 3) >> 2);
-
- . = STACK_BASE;
- .stack16 : AT(STACK_BASE) {
- HIDDEN(__stack16_start = .);
- . += STACK_LEN;
- HIDDEN(__stack16_end = .);
- }
- HIDDEN(__stack16_len = ABSOLUTE(__stack16_end) - ABSOLUTE(__stack16_start));
- HIDDEN(__stack16_dwords = (__stack16_len + 3) >> 2);
-
- /* Initialized sections */
-
- . = 0x7c00;
- .init : {
- FILL(0x90909090)
- HIDDEN(__init_start = .);
- *(.init)
- HIDDEN(__init_end = .);
- }
- HIDDEN(__init_len = ABSOLUTE(__init_end) - ABSOLUTE(__init_start));
- HIDDEN(__init_dwords = (__init_len + 3) >> 2);
-
- .text16 : {
- FILL(0x90909090)
- HIDDEN(__text16_start = .);
- *(.text16)
- HIDDEN(__text16_end = .);
- }
- HIDDEN(__text16_len = ABSOLUTE(__text16_end) - ABSOLUTE(__text16_start));
- HIDDEN(__text16_dwords = (__text16_len + 3) >> 2);
-
- /*
- * .textnr is used for 32-bit code that is used on the code
- * path to initialize the .text segment
- */
- . = ALIGN(16);
- .textnr : {
- FILL(0x90909090)
- HIDDEN(__textnr_start = .);
- *(.textnr)
- HIDDEN(__textnr_end = .);
- }
- HIDDEN(__textnr_len = ABSOLUTE(__textnr_end) - ABSOLUTE(__textnr_start));
- HIDDEN(__textnr_dwords = (__textnr_len + 3) >> 2);
-
- . = ALIGN(16);
- HIDDEN(__bcopyxx_start = .);
-
- .bcopyxx.text : {
- FILL(0x90909090)
- HIDDEN(__bcopyxx_text_start = .);
- *(.bcopyxx.text)
- HIDDEN(__bcopyxx_text_end = .);
- }
- HIDDEN(__bcopyxx_text_len = ABSOLUTE(__bcopyxx_text_end) - ABSOLUTE(__bcopyxx_text_start));
- HIDDEN(__bcopyxx_text_dwords = (__bcopyxx_text_len + 3) >> 2);
-
- .bcopyxx.data : {
- HIDDEN(__bcopyxx_data_start = .);
- *(.bcopyxx.text)
- HIDDEN(__bcopyxx_data_end = .);
- }
- HIDDEN(__bcopyxx_data_len = ABSOLUTE(__bcopyxx_data_end) - ABSOLUTE(__bcopyxx_data_start));
- HIDDEN(__bcopyxx_data_dwords = (__bcopyxx_data_len + 3) >> 2);
-
- HIDDEN(__bcopyxx_end = .);
- HIDDEN(__bcopyxx_len = ABSOLUTE(__bcopyxx_end) - ABSOLUTE(__bcopyxx_start));
- HIDDEN(__bcopyxx_dwords = (__bcopyxx_len + 3) >> 2);
-
- . = ALIGN(4);
- .data16 : {
- HIDDEN(__data16_start = .);
- *(.data16)
- HIDDEN(__data16_end = .);
- }
- HIDDEN(__data16_len = ABSOLUTE(__data16_end) - ABSOLUTE(__data16_start));
- HIDDEN(__data16_dwords = (__data16_len + 3) >> 2);
-
- . = ALIGN(4);
- HIDDEN(__config_lma = .);
- . += SIZEOF(.config);
-
- . = ALIGN(4);
- HIDDEN(__replacestub_lma = .);
- . += SIZEOF(.replacestub);
-
- /* The 32-bit code loads above the non-progbits sections */
-
- . = ALIGN(16);
- HIDDEN(__pm_code_lma = .);
-
- HIDDEN(__high_clear_start = .);
-
- . = ALIGN(512);
- .adv (NOLOAD) : {
- HIDDEN(__adv_start = .);
- *(.adv)
- HIDDEN(__adv_end = .);
- }
- HIDDEN(__adv_len = ABSOLUTE(__adv_end) - ABSOLUTE(__adv_start));
- HIDDEN(__adv_dwords = (__adv_len + 3) >> 2);
-
- /* Late uninitialized sections */
-
- . = ALIGN(4);
- .uibss (NOLOAD) : {
- HIDDEN(__uibss_start = .);
- *(.uibss)
- HIDDEN(__uibss_end = .);
- }
- HIDDEN(__uibss_len = ABSOLUTE(__uibss_end) - ABSOLUTE(__uibss_start));
- HIDDEN(__uibss_dwords = (__uibss_len + 3) >> 2);
-
- HIDDEN(_end16 = .);
- HIDDEN(__assert_end16 = ASSERT(_end16 <= 0x10000, "64K overflow"));
-
- /*
- * Special 16-bit segments
- */
-
- . = ALIGN(65536);
- .real_mode (NOLOAD) : {
- *(.real_mode)
- }
- HIDDEN(real_mode_seg = core_real_mode >> 4);
-
- . = ALIGN(65536);
- .xfer_buf (NOLOAD) : {
- *(.xfer_buf)
- }
- HIDDEN(xfer_buf_seg = core_xfer_buf >> 4);
-
- /*
- * Used to allocate lowmem buffers from 32-bit code
- */
- .lowmem (NOLOAD) : {
- HIDDEN(__lowmem_start = .);
- *(.lowmem)
- HIDDEN(__lowmem_end = .);
- }
- HIDDEN(__lowmem_len = ABSOLUTE(__lowmem_end) - ABSOLUTE(__lowmem_start));
- HIDDEN(__lowmem_dwords = (__lowmem_len + 3) >> 2);
-
- HIDDEN(__high_clear_end = .);
-
- HIDDEN(__high_clear_len = ABSOLUTE(__high_clear_end) - ABSOLUTE(__high_clear_start));
- HIDDEN(__high_clear_dwords = (__high_clear_len + 3) >> 2);
-
- /* Start of the lowmem heap */
- . = ALIGN(16);
- HIDDEN(__lowmem_heap = .);
-
- /*
- * 32-bit code. This is a hack for the moment due to the
- * real-mode segments also allocated.
- */
-
- . = 0x100000;
-
- HIDDEN(__pm_code_start = .);
-
- HIDDEN(__text_vma = .);
- HIDDEN(__text_lma = __pm_code_lma);
- .text : AT(__text_lma) {
- FILL(0x90909090)
- HIDDEN(__text_start = .);
- *(.text)
- *(.text.*)
- HIDDEN(__text_end = .);
- }
-
- . = ALIGN(16);
-
- HIDDEN(__rodata_vma = .);
- HIDDEN(__rodata_lma = __rodata_vma + __text_lma - __text_vma);
- .rodata : AT(__rodata_lma) {
- HIDDEN(__rodata_start = .);
- *(.rodata)
- *(.rodata.*)
- HIDDEN(__rodata_end = .);
- }
-
- . = ALIGN(4);
-
- HIDDEN(__ctors_vma = .);
- HIDDEN(__ctors_lma = __ctors_vma + __text_lma - __text_vma);
- .ctors : AT(__ctors_lma) {
- HIDDEN(__ctors_start = .);
- KEEP (*(SORT(.preinit_array*)))
- KEEP (*(SORT(.init_array*)))
- KEEP (*(SORT(.ctors*)))
- HIDDEN(__ctors_end = .);
- }
-
- HIDDEN(__dtors_vma = .);
- HIDDEN(__dtors_lma = __dtors_vma + __text_lma - __text_vma);
- .dtors : AT(__dtors_lma) {
- HIDDEN(__dtors_start = .);
- KEEP (*(SORT(.fini_array*)))
- KEEP (*(SORT(.dtors*)))
- HIDDEN(__dtors_end = .);
- }
-
- . = ALIGN(4);
-
- HIDDEN(__dynsym_vma = .);
- HIDDEN(__dynsym_lma = __dynsym_vma + __text_lma - __text_vma);
- .dynsym : AT(__dynsym_lma) {
- HIDDEN(__dynsym_start = .);
- *(.dynsym)
- HIDDEN(__dynsym_end = .);
- }
- HIDDEN(__dynsym_len = __dynsym_end - __dynsym_start);
-
- . = ALIGN(4);
-
- HIDDEN(__dynstr_vma = .);
- HIDDEN(__dynstr_lma = __dynstr_vma + __text_lma - __text_vma);
- .dynstr : AT(__dynstr_lma) {
- HIDDEN(__dynstr_start = .);
- *(.dynstr)
- HIDDEN(__dynstr_end = .);
- }
- HIDDEN(__dynstr_len = __dynstr_end - __dynstr_start);
-
- . = ALIGN(4);
-
- HIDDEN(__gnu_hash_vma = .);
- HIDDEN(__gnu_hash_lma = __gnu_hash_vma + __text_lma - __text_vma);
- .gnu.hash : AT(__gnu_hash_lma) {
- HIDDEN(__gnu_hash_start = .);
- *(.gnu.hash)
- HIDDEN(__gnu_hash_end = .);
- }
-
-
- . = ALIGN(4);
-
- HIDDEN(__dynlink_vma = .);
- HIDDEN(__dynlink_lma = __dynlink_vma + __text_lma - __text_vma);
- .dynlink : AT(__dynlink_lma) {
- HIDDEN(__dynlink_start = .);
- *(.dynlink)
- HIDDEN(__dynlink_end = .);
- }
-
- . = ALIGN(4);
-
- HIDDEN(__got_vma = .);
- HIDDEN(__got_lma = __got_vma + __text_lma - __text_vma);
- .got : AT(__got_lma) {
- HIDDEN(__got_start = .);
- KEEP (*(.got.plt))
- KEEP (*(.got))
- HIDDEN(__got_end = .);
- }
-
- . = ALIGN(4);
-
- HIDDEN(__dynamic_vma = .);
- HIDDEN(__dynamic_lma = __dynamic_vma + __text_lma - __text_vma);
- .dynamic : AT(__dynamic_lma) {
- HIDDEN(__dynamic_start = .);
- *(.dynamic)
- HIDDEN(__dynamic_end = .);
- }
-
- . = ALIGN(16);
-
- HIDDEN(__data_vma = .);
- HIDDEN(__data_lma = __data_vma + __text_lma - __text_vma);
- .data : AT(__data_lma) {
- HIDDEN(__data_start = .);
- *(.data)
- *(.data.*)
- HIDDEN(__data_end = .);
- }
-
- HIDDEN(__pm_code_end = .);
- HIDDEN(__pm_code_len = ABSOLUTE(__pm_code_end) - ABSOLUTE(__pm_code_start));
- HIDDEN(__pm_code_dwords = (__pm_code_len + 3) >> 2);
-
- . = ALIGN(128);
-
- HIDDEN(__bss_vma = .);
- HIDDEN(__bss_lma = .); /* Dummy */
- .bss (NOLOAD) : AT (__bss_lma) {
- HIDDEN(__bss_start = .);
- *(.bss)
- *(.bss.*)
- *(COMMON)
- HIDDEN(__bss_end = .);
- }
- HIDDEN(__bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start));
- HIDDEN(__bss_dwords = (__bss_len + 3) >> 2);
-
- /* Data saved away before bss initialization */
- . = ALIGN(128);
-
- HIDDEN(__savedata_vma = .);
- HIDDEN(__savedata_lma = .); /* Dummy */
- .savedata (NOLOAD) : AT (__savedata_lma) {
- HIDDEN(__savedata_start = .);
- *(.savedata)
- *(.savedata.*)
- HIDDEN(__savedata_end = .);
- }
- HIDDEN(__savedata_len = ABSOLUTE(__savedata_end) - ABSOLUTE(__savedata_start));
- HIDDEN(__savedata_dwords = (__savedata_len + 3) >> 2);
-
- /* XXX: This stack should be unified with the COM32 stack */
- HIDDEN(__stack_vma = .);
- __stack_lma = .; /* Dummy */
- .stack (NOLOAD) : AT(__stack_lma) {
- HIDDEN(__stack_start = .);
- *(.stack)
- HIDDEN(__stack_end = .);
- }
- HIDDEN(__stack_len = ABSOLUTE(__stack_end) - ABSOLUTE(__stack_start));
- HIDDEN(__stack_dwords = (__stack_len + 3) >> 2);
-
- HIDDEN(_end = .);
-
- /* Heap follows after our own PM code */
- . = ALIGN(65536);
- HIDDEN(free_high_memory = .);
-
- /* Stuff we don't need... */
- /DISCARD/ : {
- *(.eh_frame)
- }
-}
diff --git a/core/x86_64/syslinux.ld b/core/x86_64/syslinux.ld
deleted file mode 100644
index 70c6e00a..00000000
--- a/core/x86_64/syslinux.ld
+++ /dev/null
@@ -1,389 +0,0 @@
-/* -----------------------------------------------------------------------
- *
- * Copyright 2008-2009 H. Peter Anvin - All Rights Reserved
- * Copyright 2009 Intel Corporation; author: H. Peter Anvin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston MA 02110-1301, USA; either version 2 of the License, or
- * (at your option) any later version; incorporated herein by reference.
- *
- * ----------------------------------------------------------------------- */
-
-/*
- * Linker script for the SYSLINUX core
- */
-
-OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
-OUTPUT_ARCH(i386:x86-64)
-EXTERN(_start)
-ENTRY(_start)
-
-STACK32_LEN = 65536;
-
-SECTIONS
-{
- /* Prefix structure for the compression program */
- . = 0;
- __module_start = .;
- .prefix : {
- *(.prefix)
- }
-
- /* "Early" sections (before the load) */
- . = 0x1000;
-
- .earlybss (NOLOAD) : {
- __earlybss_start = .;
- *(.earlybss)
- __earlybss_end = .;
- }
- __earlybss_len = ABSOLUTE(__earlybss_end) - ABSOLUTE(__earlybss_start);
- __earlybss_dwords = (__earlybss_len + 3) >> 2;
-
- . = ALIGN(4);
- .bss16 (NOLOAD) : {
- __bss16_start = .;
- *(.bss16)
- __bss16_end = .;
- }
- __bss16_len = ABSOLUTE(__bss16_end) - ABSOLUTE(__bss16_start);
- __bss16_dwords = (__bss16_len + 3) >> 2;
-
- . = ALIGN(4);
- .config : AT (__config_lma) {
- __config_start = .;
- *(.config)
- __config_end = .;
- }
- __config_len = ABSOLUTE(__config_end) - ABSOLUTE(__config_start);
- __config_dwords = (__config_len + 3) >> 2;
-
- /* Generated and/or copied code */
-
- . = ALIGN(128); /* Minimum separation from mutable data */
- .replacestub : AT (__replacestub_lma) {
- __replacestub_start = .;
- *(.replacestub)
- __replacestub_end = .;
- }
- __replacestub_len = ABSOLUTE(__replacestub_end) - ABSOLUTE(__replacestub_start);
- __replacestub_dwords = (__replacestub_len + 3) >> 2;
-
- . = ALIGN(16);
- __gentextnr_lma = .;
- .gentextnr : AT(__gentextnr_lma) {
- __gentextnr_start = .;
- *(.gentextnr)
- __gentextnr_end = .;
- }
- __gentextnr_len = ABSOLUTE(__gentextnr_end) - ABSOLUTE(__gentextnr_start);
- __gentextnr_dwords = (__gentextnr_len + 3) >> 2;
-
- . = STACK_BASE;
- .stack16 : AT(STACK_BASE) {
- __stack16_start = .;
- . += STACK_LEN;
- __stack16_end = .;
- }
- __stack16_len = ABSOLUTE(__stack16_end) - ABSOLUTE(__stack16_start);
- __stack16_dwords = (__stack16_len + 3) >> 2;
-
- /* Initialized sections */
-
- . = 0x7c00;
- .init : {
- FILL(0x90909090)
- __init_start = .;
- *(.init)
- __init_end = .;
- }
- __init_len = ABSOLUTE(__init_end) - ABSOLUTE(__init_start);
- __init_dwords = (__init_len + 3) >> 2;
-
- .text16 : {
- FILL(0x90909090)
- __text16_start = .;
- *(.text16)
- __text16_end = .;
- }
- __text16_len = ABSOLUTE(__text16_end) - ABSOLUTE(__text16_start);
- __text16_dwords = (__text16_len + 3) >> 2;
-
- /*
- * .textnr is used for 32-bit code that is used on the code
- * path to initialize the .text segment
- */
- . = ALIGN(16);
- .textnr : {
- FILL(0x90909090)
- __textnr_start = .;
- *(.textnr)
- __textnr_end = .;
- }
- __textnr_len = ABSOLUTE(__textnr_end) - ABSOLUTE(__textnr_start);
- __textnr_dwords = (__textnr_len + 3) >> 2;
-
- . = ALIGN(16);
- __bcopyxx_start = .;
-
- .bcopyxx.text : {
- FILL(0x90909090)
- __bcopyxx_text_start = .;
- *(.bcopyxx.text)
- __bcopyxx_text_end = .;
- }
- __bcopyxx_text_len = ABSOLUTE(__bcopyxx_text_end) - ABSOLUTE(__bcopyxx_text_start);
- __bcopyxx_text_dwords = (__bcopyxx_text_len + 3) >> 2;
-
- .bcopyxx.data : {
- __bcopyxx_data_start = .;
- *(.bcopyxx.text)
- __bcopyxx_data_end = .;
- }
- __bcopyxx_data_len = ABSOLUTE(__bcopyxx_data_end) - ABSOLUTE(__bcopyxx_data_start);
- __bcopyxx_data_dwords = (__bcopyxx_data_len + 3) >> 2;
-
- __bcopyxx_end = .;
- __bcopyxx_len = ABSOLUTE(__bcopyxx_end) - ABSOLUTE(__bcopyxx_start);
- __bcopyxx_dwords = (__bcopyxx_len + 3) >> 2;
-
- . = ALIGN(4);
- .data16 : {
- __data16_start = .;
- *(.data16)
- __data16_end = .;
- }
- __data16_len = ABSOLUTE(__data16_end) - ABSOLUTE(__data16_start);
- __data16_dwords = (__data16_len + 3) >> 2;
-
- . = ALIGN(4);
- __config_lma = .;
- . += SIZEOF(.config);
-
- . = ALIGN(4);
- __replacestub_lma = .;
- . += SIZEOF(.replacestub);
-
- /* The 32-bit code loads above the non-progbits sections */
-
- . = ALIGN(16);
- __pm_code_lma = .;
-
- __high_clear_start = .;
-
- . = ALIGN(512);
- .adv (NOLOAD) : {
- __adv_start = .;
- *(.adv)
- __adv_end = .;
- }
- __adv_len = ABSOLUTE(__adv_end) - ABSOLUTE(__adv_start);
- __adv_dwords = (__adv_len + 3) >> 2;
-
- /* Late uninitialized sections */
-
- . = ALIGN(4);
- .uibss (NOLOAD) : {
- __uibss_start = .;
- *(.uibss)
- __uibss_end = .;
- }
- __uibss_len = ABSOLUTE(__uibss_end) - ABSOLUTE(__uibss_start);
- __uibss_dwords = (__uibss_len + 3) >> 2;
-
- _end16 = .;
- __assert_end16 = ASSERT(_end16 <= 0x10000, "64K overflow");
-
- /*
- * Special 16-bit segments
- */
-
- . = ALIGN(65536);
- .real_mode (NOLOAD) : {
- *(.real_mode)
- }
- real_mode_seg = core_real_mode >> 4;
-
- . = ALIGN(65536);
- .xfer_buf (NOLOAD) : {
- *(.xfer_buf)
- }
- xfer_buf_seg = core_xfer_buf >> 4;
-
- /*
- * The auxilliary data segment is used by the 16-bit code
- * for items that don't need to live in the bottom 64K.
- */
-
- . = ALIGN(16);
- .auxseg (NOLOAD) : {
- __auxseg_start = .;
- *(.auxseg)
- __auxseg_end = .;
- }
- __auxseg_len = ABSOLUTE(__auxseg_end) - ABSOLUTE(__auxseg_start);
- __auxseg_dwords = (__auxseg_len + 3) >> 2;
- aux_seg = __auxseg_start >> 4;
-
- /*
- * Used to allocate lowmem buffers from 32-bit code
- */
- .lowmem (NOLOAD) : {
- __lowmem_start = .;
- *(.lowmem)
- __lowmem_end = .;
- }
- __lowmem_len = ABSOLUTE(__lowmem_end) - ABSOLUTE(__lowmem_start);
- __lowmem_dwords = (__lowmem_len + 3) >> 2;
-
- __high_clear_end = .;
-
- __high_clear_len = ABSOLUTE(__high_clear_end) - ABSOLUTE(__high_clear_start);
- __high_clear_dwords = (__high_clear_len + 3) >> 2;
-
- /* Start of the lowmem heap */
- . = ALIGN(16);
- __lowmem_heap = .;
-
- /*
- * 32-bit code. This is a hack for the moment due to the
- * real-mode segments also allocated.
- */
-
- . = 0x100000;
-
- __pm_code_start = .;
- __vma_to_lma = __pm_code_lma - __pm_code_start;
-
- .text : AT(ADDR(.text) + __vma_to_lma) {
- FILL(0x90909090)
- __text_start = .;
- *(.text)
- *(.text.*)
- __text_end = .;
- }
-
- .rodata : AT(ADDR(.rodata) + __vma_to_lma) {
- __rodata_start = .;
- *(.rodata)
- *(.rodata.*)
- __rodata_end = .;
- }
-
- .ctors : AT(ADDR(.ctors) + __vma_to_lma) {
- __ctors_start = .;
- KEEP (*(SORT(.ctors.*)))
- KEEP (*(.ctors))
- __ctors_end = .;
- }
-
- .dtors : AT(ADDR(.dtors) + __vma_to_lma) {
- __dtors_start = .;
- KEEP (*(SORT(.dtors.*)))
- KEEP (*(.dtors))
- __dtors_end = .;
- }
-
- .dynsym : AT(ADDR(.dynsym) + __vma_to_lma) {
- __dynsym_start = .;
- *(.dynsym)
- __dynsym_end = .;
- }
- __dynsym_len = __dynsym_end - __dynsym_start;
-
- .dynstr : AT(ADDR(.dynstr) + __vma_to_lma) {
- __dynstr_start = .;
- *(.dynstr)
- __dynstr_end = .;
- }
- __dynstr_len = __dynstr_end - __dynstr_start;
-
- .gnu.hash : AT(ADDR(.gnu.hash) + __vma_to_lma) {
- __gnu_hash_start = .;
- *(.gnu.hash)
- __gnu_hash_end = .;
- }
-
-
- .dynlink : AT(ADDR(.dynlink) + __vma_to_lma) {
- __dynlink_start = .;
- *(.dynlink)
- __dynlink_end = .;
- }
-
- .got : AT(ADDR(.got) + __vma_to_lma) {
- __got_start = .;
- KEEP (*(.got.plt))
- KEEP (*(.got))
- __got_end = .;
- }
-
- .dynamic : AT(ADDR(.dynamic) + __vma_to_lma) {
- __dynamic_start = .;
- *(.dynamic)
- __dynamic_end = .;
- }
-
- .data : AT(ADDR(.data) + __vma_to_lma) {
- __data_start = .;
- *(.data)
- *(.data.*)
- __data_end = .;
- }
-
- __pm_code_end = .;
- __pm_code_len = ABSOLUTE(__pm_code_end) - ABSOLUTE(__pm_code_start);
- __pm_code_dwords = (__pm_code_len + 3) >> 2;
-
- . = ALIGN(128);
-
- __bss_vma = .;
- __bss_lma = .; /* Dummy */
- .bss (NOLOAD) : AT (__bss_lma) {
- __bss_start = .;
- *(.bss)
- *(.bss.*)
- *(COMMON)
- __bss_end = .;
- }
- __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
- __bss_dwords = (__bss_len + 3) >> 2;
-
- /* Very large objects which don't need to be zeroed */
-
- __hugebss_vma = .;
- __hugebss_lma = .; /* Dummy */
- .hugebss (NOLOAD) : AT (__hugebss_lma) {
- __hugebss_start = .;
- *(.hugebss)
- *(.hugebss.*)
- __hugebss_end = .;
- }
- __hugebss_len = ABSOLUTE(__hugebss_end) - ABSOLUTE(__hugebss_start);
- __hugebss_dwords = (__hugebss_len + 3) >> 2;
-
-
- /* XXX: This stack should be unified with the COM32 stack */
- __stack_vma = .;
- __stack_lma = .; /* Dummy */
- .stack (NOLOAD) : AT(__stack_lma) {
- __stack_start = .;
- *(.stack)
- __stack_end = .;
- }
- __stack_len = ABSOLUTE(__stack_end) - ABSOLUTE(__stack_start);
- __stack_dwords = (__stack_len + 3) >> 2;
-
- _end = .;
-
- /* COM32R and kernels are loaded after our own PM code */
- . = ALIGN(65536);
- free_high_memory = .;
-
- /* Stuff we don't need... */
- /DISCARD/ : {
- *(.eh_frame)
- }
-}
diff --git a/mk/com32.mk b/mk/com32.mk
index 2e8591a7..d32069dd 100644
--- a/mk/com32.mk
+++ b/mk/com32.mk
@@ -55,7 +55,6 @@ GCCOPT += -mregparm=3 -DREGPARM=3
endif
com32 := $(topdir)/com32
-RELOCS := $(com32)/tools/relocs
ifneq ($(NOGPL),1)
GPLLIB = $(com32)/gpllib/libcom32gpl.a