• Vivek Goyal's avatar
    [PATCH] i386: Distinguish absolute symbols · 6569580d
    Vivek Goyal authored
    Ld knows about 2 kinds of symbols,  absolute and section
    relative.  Section relative symbols symbols change value
    when a section is moved and absolute symbols do not.
    
    Currently in the linker script we have several labels
    marking the beginning and ending of sections that
    are outside of sections, making them absolute symbols.
    Having a mixture of absolute and section relative
    symbols refereing to the same data is currently harmless
    but it is confusing.
    
    This must be done carefully as newer revs of ld do not place
    symbols that appear in sections without data and instead
    ld makes those symbols global :(
    
    My ultimate goal is to build a relocatable kernel.  The
    safest and least intrusive technique is to generate
    relocation entries so the kernel can be relocated at load
    time.  The only penalty would be an increase in the size
    of the kernel binary.  The problem is that if absolute and
    relocatable symbols are not properly specified absolute symbols
    will be relocated or section relative symbols won't be, which
    is fatal.
    
    The practical motivation is that when generating kernels that
    will run from a reserved area for analyzing what caused
    a kernel panic, it is simpler if you don't need to hard code
    the physical memory location they will run at, especially
    for the distributions.
    
    [AK: and merged:]
    
    o Also put a message so that in future people can be aware of it and
      avoid introducing absolute symbols.
    Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
    Signed-off-by: default avatarVivek Goyal <vgoyal@in.ibm.com>
    Signed-off-by: default avatarAndi Kleen <ak@suse.de>
    6569580d
vmlinux.lds.S 4.8 KB