mirror of
https://github.com/ipxe/ipxe
synced 2025-12-27 01:52:39 +03:00
[i386] Simplify linker script and standardise linker-defined symbol names
Reduce the number of sections within the linker script to match the number of practical sections within the output file. Define _section, _msection, _esection, _section_filesz, _section_memsz, and _section_lma for each section, replacing the mixture of symbols that previously existed. In particular, replace _text and _end with _textdata and _etextdata, to make it explicit within code that uses these symbols that the .text and .data sections are always treated as a single contiguous block.
This commit is contained in:
@@ -18,8 +18,8 @@ extern char _max_align[];
|
||||
#define max_align ( ( unsigned int ) _max_align )
|
||||
|
||||
/* Linker symbols */
|
||||
extern char _text[];
|
||||
extern char _end[];
|
||||
extern char _textdata[];
|
||||
extern char _etextdata[];
|
||||
|
||||
/* within 1MB of 4GB is too close.
|
||||
* MAX_ADDR is the maximum address we can easily do DMA to.
|
||||
@@ -47,8 +47,8 @@ __cdecl void relocate ( struct i386_all_regs *ix86 ) {
|
||||
|
||||
/* Get memory map and current location */
|
||||
get_memmap ( &memmap );
|
||||
start = virt_to_phys ( _text );
|
||||
end = virt_to_phys ( _end );
|
||||
start = virt_to_phys ( _textdata );
|
||||
end = virt_to_phys ( _etextdata );
|
||||
size = ( end - start );
|
||||
padded_size = ( size + max_align - 1 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user