[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ld overwriting output sections???
From: |
Jakub Jermar |
Subject: |
Re: ld overwriting output sections??? |
Date: |
Sun, 11 Sep 2005 16:36:54 +0200 |
User-agent: |
Debian Thunderbird 1.0.2 (X11/20050817) |
The linker script I sent you yesterday is missing the magical line.
The one below is ok.
jj
--------
Hello binutils people,
my team discovered a strange problem with the linker script which I attach to
this email.
Depending on the presence of the line containing:
LONG(0xdeadbeaf);
the kernel image is linked together correctly (line is present) or the .mapped section overwrites
the .unmapped section (line is not present).
We use binutils 2.16 cross compiled for IA-32.
Is there anything wrong with our linking process or is it a bug in ld?
Please, Cc: me as I don't read this mailing list.
Thanks for your help,
Jakub
OUTPUT_FORMAT(binary)
ENTRY(kernel_image_start)
SECTIONS {
.unmapped 0x8000: AT (0x8000) {
unmapped_ktext_start = .;
*(K_TEXT_START);
*(K_TEXT_START_2);
unmapped_ktext_end = .;
unmapped_kdata_start = .;
*(K_DATA_START);
LONG(0xdeadbeaf);
unmapped_kdata_end = .;
}
.mapped (((0x100000 +0x8000) + 0x80000000)+SIZEOF(.unmapped)): AT (0x8000
+SIZEOF(.unmapped)) {
ktext_start = .;
*(BOOT_DATA);
*(.text);
ktext_end = .;
kdata_start = .;
*(.data);
*(.rodata*);
*(COMMON);
hardcoded_load_address = .;
LONG(((0x100000 +0x8000) + 0x80000000));
hardcoded_ktext_size = .;
LONG((ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start));
hardcoded_kdata_size = .;
LONG((kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start));
hardcoded_unmapped_ktext_size = .;
LONG(unmapped_ktext_end - unmapped_ktext_start);
hardcoded_unmapped_kdata_size = .;
LONG(unmapped_kdata_end - unmapped_kdata_start);
*(.bss);
*(.note.GNU-stack);
*(.comment);
symbol_table = .;
*(symtab.*);
kdata_end = .;
}
_hardcoded_kernel_size = (ktext_end - ktext_start) + (unmapped_ktext_end -
unmapped_ktext_start) + (kdata_end - kdata_start) + (unmapped_kdata_end -
unmapped_kdata_start);
_hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) +
(unmapped_kdata_end - unmapped_kdata_start);
e820table_boot = ((e820table) - 0x80000000) - 0x100000;
e820counter_boot = ((e820counter) - 0x80000000) - 0x100000;
real_bootstrap_gdtr = ((real_bootstrap_gdtr_boot) + 0x80000000);
}