Commit bed7a560 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
  kbuild: Do not overwrite makefile as anohter user
  kbuild: drivers/video/logo/ - fix ident glitch
  kbuild: fix gen_initramfs_list.sh
  kbuild modpost - relax driver data name
  kbuild: removing .tmp_versions considered harmful
  kbuild: fix modpost segfault for 64bit mipsel kernel
parents 75dff55a fd5f0cd6
...@@ -344,16 +344,14 @@ scripts_basic: ...@@ -344,16 +344,14 @@ scripts_basic:
scripts/basic/%: scripts_basic ; scripts/basic/%: scripts_basic ;
PHONY += outputmakefile PHONY += outputmakefile
# outputmakefile generate a Makefile to be placed in output directory, if # outputmakefile generates a Makefile in the output directory, if using a
# using a seperate output directory. This allows convinient use # separate output directory. This allows convenient use of make in the
# of make in output directory # output directory.
outputmakefile: outputmakefile:
$(Q)if test ! $(srctree) -ef $(objtree); then \ ifneq ($(KBUILD_SRC),)
$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
$(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \ $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
> $(objtree)/Makefile; \ endif
echo ' GEN $(objtree)/Makefile'; \
fi
# To make sure we do not include .config for any of the *config targets # To make sure we do not include .config for any of the *config targets
# catch them early, and hand them over to scripts/kconfig/Makefile # catch them early, and hand them over to scripts/kconfig/Makefile
...@@ -796,8 +794,8 @@ prepare2: prepare3 outputmakefile ...@@ -796,8 +794,8 @@ prepare2: prepare3 outputmakefile
prepare1: prepare2 include/linux/version.h include/asm \ prepare1: prepare2 include/linux/version.h include/asm \
include/config/MARKER include/config/MARKER
ifneq ($(KBUILD_MODULES),) ifneq ($(KBUILD_MODULES),)
$(Q)rm -rf $(MODVERDIR)
$(Q)mkdir -p $(MODVERDIR) $(Q)mkdir -p $(MODVERDIR)
$(Q)rm -f $(MODVERDIR)/*
endif endif
archprepare: prepare1 scripts_basic archprepare: prepare1 scripts_basic
...@@ -1086,8 +1084,8 @@ else # KBUILD_EXTMOD ...@@ -1086,8 +1084,8 @@ else # KBUILD_EXTMOD
KBUILD_MODULES := 1 KBUILD_MODULES := 1
PHONY += crmodverdir PHONY += crmodverdir
crmodverdir: crmodverdir:
$(Q)rm -rf $(MODVERDIR)
$(Q)mkdir -p $(MODVERDIR) $(Q)mkdir -p $(MODVERDIR)
$(Q)rm -f $(MODVERDIR)/*
PHONY += $(objtree)/Module.symvers PHONY += $(objtree)/Module.symvers
$(objtree)/Module.symvers: $(objtree)/Module.symvers:
......
...@@ -200,7 +200,11 @@ input_file() { ...@@ -200,7 +200,11 @@ input_file() {
print_mtime "$1" >> ${output} print_mtime "$1" >> ${output}
cat "$1" >> ${output} cat "$1" >> ${output}
else else
grep ^file "$1" | cut -d ' ' -f 3 cat "$1" | while read type dir file perm ; do
if [ "$type" == "file" ]; then
echo "$file \\";
fi
done
fi fi
elif [ -d "$1" ]; then elif [ -d "$1" ]; then
dir_filelist "$1" dir_filelist "$1"
......
...@@ -10,7 +10,10 @@ ...@@ -10,7 +10,10 @@
# $4 - patchlevel # $4 - patchlevel
cat << EOF test ! -r $2/Makefile -o -O $2/Makefile || exit 0
echo " GEN $2/Makefile"
cat << EOF > $2/Makefile
# Automatically generated by $0: don't edit # Automatically generated by $0: don't edit
VERSION = $3 VERSION = $3
......
...@@ -487,14 +487,14 @@ static int strrcmp(const char *s, const char *sub) ...@@ -487,14 +487,14 @@ static int strrcmp(const char *s, const char *sub)
* atsym =__param* * atsym =__param*
* *
* Pattern 2: * Pattern 2:
* Many drivers utilise a *_driver container with references to * Many drivers utilise a *driver container with references to
* add, remove, probe functions etc. * add, remove, probe functions etc.
* These functions may often be marked __init and we do not want to * These functions may often be marked __init and we do not want to
* warn here. * warn here.
* the pattern is identified by: * the pattern is identified by:
* tosec = .init.text | .exit.text | .init.data * tosec = .init.text | .exit.text | .init.data
* fromsec = .data * fromsec = .data
* atsym = *_driver, *_template, *_sht, *_ops, *_probe, *probe_one * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one
**/ **/
static int secref_whitelist(const char *tosec, const char *fromsec, static int secref_whitelist(const char *tosec, const char *fromsec,
const char *atsym) const char *atsym)
...@@ -502,7 +502,7 @@ static int secref_whitelist(const char *tosec, const char *fromsec, ...@@ -502,7 +502,7 @@ static int secref_whitelist(const char *tosec, const char *fromsec,
int f1 = 1, f2 = 1; int f1 = 1, f2 = 1;
const char **s; const char **s;
const char *pat2sym[] = { const char *pat2sym[] = {
"_driver", "driver",
"_template", /* scsi uses *_template a lot */ "_template", /* scsi uses *_template a lot */
"_sht", /* scsi also used *_sht to some extent */ "_sht", /* scsi also used *_sht to some extent */
"_ops", "_ops",
...@@ -709,10 +709,17 @@ static void check_sec_ref(struct module *mod, const char *modname, ...@@ -709,10 +709,17 @@ static void check_sec_ref(struct module *mod, const char *modname,
for (rela = start; rela < stop; rela++) { for (rela = start; rela < stop; rela++) {
Elf_Rela r; Elf_Rela r;
const char *secname; const char *secname;
unsigned int r_sym;
r.r_offset = TO_NATIVE(rela->r_offset); r.r_offset = TO_NATIVE(rela->r_offset);
r.r_info = TO_NATIVE(rela->r_info); if (hdr->e_ident[EI_CLASS] == ELFCLASS64 &&
hdr->e_machine == EM_MIPS) {
r_sym = ELF64_MIPS_R_SYM(rela->r_info);
r_sym = TO_NATIVE(r_sym);
} else {
r_sym = ELF_R_SYM(TO_NATIVE(rela->r_info));
}
r.r_addend = TO_NATIVE(rela->r_addend); r.r_addend = TO_NATIVE(rela->r_addend);
sym = elf->symtab_start + ELF_R_SYM(r.r_info); sym = elf->symtab_start + r_sym;
/* Skip special sections */ /* Skip special sections */
if (sym->st_shndx >= SHN_LORESERVE) if (sym->st_shndx >= SHN_LORESERVE)
continue; continue;
......
...@@ -39,6 +39,25 @@ ...@@ -39,6 +39,25 @@
#define ELF_R_TYPE ELF64_R_TYPE #define ELF_R_TYPE ELF64_R_TYPE
#endif #endif
/* The 64-bit MIPS ELF ABI uses an unusual reloc format. */
typedef struct
{
Elf32_Word r_sym; /* Symbol index */
unsigned char r_ssym; /* Special symbol for 2nd relocation */
unsigned char r_type3; /* 3rd relocation type */
unsigned char r_type2; /* 2nd relocation type */
unsigned char r_type1; /* 1st relocation type */
} _Elf64_Mips_R_Info;
typedef union
{
Elf64_Xword r_info_number;
_Elf64_Mips_R_Info r_info_fields;
} _Elf64_Mips_R_Info_union;
#define ELF64_MIPS_R_SYM(i) \
((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym)
#if KERNEL_ELFDATA != HOST_ELFDATA #if KERNEL_ELFDATA != HOST_ELFDATA
static inline void __endian(const void *src, void *dest, unsigned int size) static inline void __endian(const void *src, void *dest, unsigned int size)
......
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