grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

x86_64 imporatant information


From: Ruslan Nikolaev
Subject: x86_64 imporatant information
Date: Sat, 20 Aug 2005 16:25:32 -0700 (PDT)

In my previous post I forgot to say about the most imporatant reason to use negative addresses.
 
Take a look on the following information:
 
---------------------------------
/usr/src/linux/vmlinux:     file format elf64-x86-64
Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         00368c04  ffffffff80100000  ffffffff80100000  00100000  2**6
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 __ex_table    00005470  ffffffff80468c10  ffffffff80468c10  00468c10  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .rodata       000582ea  ffffffff8046e080  ffffffff8046e080  0046e080  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .pci_fixup    000007b0  ffffffff804c6370  ffffffff804c6370  004c6370  2**4
                  CONTENTS, ALLOC, LOAD, DATA
...
----------------------
 
It seems that VMA and LMA addresses are the same for Linux ELF under x86_64. I never interested such information for x86 and don't know how it will be for x86.
 
I think it's just because we need to use special memory model "-mcmodel=kernel" that's designed especially for kernel. Does we have problems when LMA != VMA and using this memory model? I can't find such information...
 
From x86_64 ABI:
------------------------

The AMD64 architecture usually does not allow to encode arbitrary 64-bit constants

as immediate operand of the instruction. Most instructions accept 32-bit

immediates that are sign extended to the 64-bit ones. Additionally the 32-bit operations

with register destinations implicitly perform zero extension making loads

of 64-bit immediates with upper half set to 0 even cheaper.

Additionally the branch instructions accept 32-bit immediate operands that

are sign extended and used to adjust instruction pointer. Similarly an instruction

pointer relative addressing mode exists for data accesses with equivalent limitations.


Start your day with Yahoo! - make it your home page
reply via email to

[Prev in Thread] Current Thread [Next in Thread]