diff options
Diffstat (limited to 'scripts/mod/modpost.h')
| -rw-r--r-- | scripts/mod/modpost.h | 30 | 
1 files changed, 10 insertions, 20 deletions
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index 0388cfccac8..168b43dc0a5 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h @@ -113,6 +113,7 @@ struct module {  	int has_cleanup;  	struct buffer dev_table_buf;  	char	     srcversion[25]; +	int is_dot_o;  };  struct elf_info { @@ -126,7 +127,7 @@ struct elf_info {  	Elf_Section  export_gpl_sec;  	Elf_Section  export_unused_gpl_sec;  	Elf_Section  export_gpl_future_sec; -	const char   *strtab; +	char         *strtab;  	char	     *modinfo;  	unsigned int modinfo_len; @@ -145,33 +146,22 @@ static inline int is_shndx_special(unsigned int i)  	return i != SHN_XINDEX && i >= SHN_LORESERVE && i <= SHN_HIRESERVE;  } -/* shndx is in [0..SHN_LORESERVE) U (SHN_HIRESERVE, 0xfffffff], thus: - * shndx == 0               <=> sechdrs[0] - * ...... - * shndx == SHN_LORESERVE-1 <=> sechdrs[SHN_LORESERVE-1] - * shndx == SHN_HIRESERVE+1 <=> sechdrs[SHN_LORESERVE] - * shndx == SHN_HIRESERVE+2 <=> sechdrs[SHN_LORESERVE+1] - * ...... - * fyi: sym->st_shndx is uint16, SHN_LORESERVE = ff00, SHN_HIRESERVE = ffff, - * so basically we map  0000..feff -> 0000..feff - *                      ff00..ffff -> (you are a bad boy, dont do it) - *                     10000..xxxx -> ff00..(xxxx-0x100) +/* + * Move reserved section indices SHN_LORESERVE..SHN_HIRESERVE out of + * the way to -256..-1, to avoid conflicting with real section + * indices.   */ -static inline unsigned int shndx2secindex(unsigned int i) -{ -	if (i <= SHN_HIRESERVE) -		return i; -	return i - (SHN_HIRESERVE + 1 - SHN_LORESERVE); -} +#define SPECIAL(i) ((i) - (SHN_HIRESERVE + 1))  /* Accessor for sym->st_shndx, hides ugliness of "64k sections" */  static inline unsigned int get_secindex(const struct elf_info *info,  					const Elf_Sym *sym)  { +	if (is_shndx_special(sym->st_shndx)) +		return SPECIAL(sym->st_shndx);  	if (sym->st_shndx != SHN_XINDEX)  		return sym->st_shndx; -	return shndx2secindex(info->symtab_shndx_start[sym - -						       info->symtab_start]); +	return info->symtab_shndx_start[sym - info->symtab_start];  }  /* file2alias.c */  | 
