Commit aae7d999 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Fix __start_SECTION, __stop_SECTION

In a discussion with Sam Ravnborg, the following problem became apparent:
Most vmlinux.lds.S (but the ARM ones) used the following construct:
  
       __start___ksymtab = .;                                          
       __ksymtab         : AT(ADDR(__ksymtab) - LOAD_OFFSET) {         
               *(__ksymtab)                                            
       }                                                               
       __stop___ksymtab = .;                                           
  
However, the link will align the beginning of the section __ksymtab
according to the requirements for the input sections. If '.' (current
location counter) wasn't sufficiently aligned before, it's possible
that __ksymtab actually starts at an address after the one
__start___ksymtab points to, which will confuse the users of
__start___ksymtab badly. The fix is to follow what the ARM Makefiles
did for this case, ie
  
       __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) {                 
               __start___ksymtab = .;                                  
               *(__ksymtab)                                            
               __stop___ksymtab = .;                                   
       }                                                               
parent 6a3354a9
......@@ -13,18 +13,18 @@
} \
\
/* Kernel symbol table: Normal symbols */ \
__start___ksymtab = .; \
__ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
__start___ksymtab = .; \
*(__ksymtab) \
__stop___ksymtab = .; \
} \
__stop___ksymtab = .; \
\
/* Kernel symbol table: GPL-only symbols */ \
__start___gpl_ksymtab = .; \
__gpl_ksymtab : AT(ADDR(__gpl_ksymtab) - LOAD_OFFSET) { \
__start___gpl_ksymtab = .; \
*(__gpl_ksymtab) \
__stop___gpl_ksymtab = .; \
} \
__stop___gpl_ksymtab = .; \
\
/* Kernel symbol table: strings */ \
__ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment