Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 6 May 2007 20:21:57 +0000 (13:21 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 6 May 2007 20:21:57 +0000 (13:21 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: (38 commits)
  kconfig: fix mconf segmentation fault
  kbuild: enable use of code from a different dir
  kconfig: error out if recursive dependencies are found
  kbuild: scripts/basic/fixdep segfault on pathological string-o-death
  kconfig: correct minor typo in Kconfig warning message.
  kconfig: fix path to modules.txt in Kconfig help
  usr/Kconfig: fix typo
  kernel-doc: alphabetically-sorted entries in index.html of 'htmldocs'
  kbuild: be more explicit on missing .config file
  kbuild: clarify the creation of the LOCALVERSION_AUTO string.
  kbuild: propagate errors from find in scripts/gen_initramfs_list.sh
  kconfig: refer to qt3 if we cannot find qt libraries
  kbuild: handle compressed cpio initramfs-es
  kbuild: ignore section mismatch warning for references from .paravirtprobe to .init.text
  kbuild: remove stale comment in modpost.c
  kbuild/mkuboot.sh: allow spaces in CROSS_COMPILE
  kbuild: fix make mrproper for Documentation/DocBook/man
  kbuild: remove kconfig binaries during make mrproper
  kconfig/menuconfig: do not hardcode '.config'
  kbuild: override build timestamp & version
  ...

1  2 
Makefile
drivers/net/Kconfig
drivers/scsi/Kconfig
drivers/video/Kconfig
include/linux/input.h
init/main.c
scripts/mod/modpost.c

diff --combined Makefile
+++ b/Makefile
@@@ -491,7 -491,7 +491,7 @@@ endi
  include $(srctree)/arch/$(ARCH)/Makefile
  
  ifdef CONFIG_FRAME_POINTER
 -CFLAGS                += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
 +CFLAGS                += -fno-omit-frame-pointer -fno-optimize-sibling-calls
  else
  CFLAGS                += -fomit-frame-pointer
  endif
@@@ -576,7 -576,7 +576,7 @@@ libs-y             := $(libs-y1) $(libs-y2
  # ---------------------------------------------------------------------------
  # vmlinux is built from the objects selected by $(vmlinux-init) and
  # $(vmlinux-main). Most are built-in.o files from top-level directories
- # in the kernel tree, others are specified in arch/$(ARCH)Makefile.
+ # in the kernel tree, others are specified in arch/$(ARCH)/Makefile.
  # Ordering when linking is important, and $(vmlinux-init) must be first.
  #
  # vmlinux
@@@ -603,6 -603,7 +603,7 @@@ vmlinux-init := $(head-y) $(init-y
  vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y)
  vmlinux-all  := $(vmlinux-init) $(vmlinux-main)
  vmlinux-lds  := arch/$(ARCH)/kernel/vmlinux.lds
+ export KBUILD_VMLINUX_OBJS := $(vmlinux-all)
  
  # Rule to link vmlinux - also used during CONFIG_KALLSYMS
  # May be overridden by arch/$(ARCH)/Makefile
@@@ -855,6 -856,7 +856,7 @@@ archprepare: prepare1 scripts_basi
  
  prepare0: archprepare FORCE
        $(Q)$(MAKE) $(build)=.
+       $(Q)$(MAKE) $(build)=. missing-syscalls
  
  # All the preparing..
  prepare: prepare0
@@@ -1277,10 -1279,7 +1279,7 @@@ endi
  ALLSOURCE_ARCHS := $(ARCH)
  
  define find-sources
-         ( find $(__srctree) $(RCS_FIND_IGNORE) \
-              \( -name include -o -name arch \) -prune -o \
-              -name $1 -print; \
-         for ARCH in $(ALLSOURCE_ARCHS) ; do \
+         ( for ARCH in $(ALLSOURCE_ARCHS) ; do \
               find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \
                    -name $1 -print; \
          done ; \
                    -name $1 -print; \
          done ; \
          find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
-              -name $1 -print )
+              -name $1 -print; \
+         find $(__srctree) $(RCS_FIND_IGNORE) \
+              \( -name include -o -name arch \) -prune -o \
+              -name $1 -print; \
+         )
  endef
  
  define all-sources
diff --combined drivers/net/Kconfig
@@@ -311,7 -311,7 +311,7 @@@ config MAC839
  
  config MAC89x0
        tristate "Macintosh CS89x0 based ethernet cards"
 -      depends on NET_ETHERNET && MAC && BROKEN
 +      depends on NET_ETHERNET && MAC
        ---help---
          Support for CS89x0 chipset based Ethernet cards.  If you have a
          Nubus or LC-PDS network (Ethernet) card of this type, say Y and
@@@ -337,8 -337,8 +337,8 @@@ config MACSONI
          be called macsonic.
  
  config MACMACE
 -      bool "Macintosh (AV) onboard MACE ethernet (EXPERIMENTAL)"
 -      depends on NET_ETHERNET && MAC && EXPERIMENTAL
 +      bool "Macintosh (AV) onboard MACE ethernet"
 +      depends on NET_ETHERNET && MAC
        select CRC32
        help
          Support for the onboard AMD 79C940 MACE Ethernet controller used in
@@@ -833,8 -833,8 +833,8 @@@ config SMC91
          This driver is also available as a module ( = code which can be
          inserted in and removed from the running kernel whenever you want).
          The module will be called smc91x.  If you want to compile it as a
-         module, say M here and read <file:Documentation/modules.txt> as well
-         as <file:Documentation/networking/net-modules.txt>.
+         module, say M here and read <file:Documentation/kbuild/modules.txt>
+         as well as <file:Documentation/networking/net-modules.txt>.
  
  config SMC9194
        tristate "SMC 9194 support"
@@@ -889,7 -889,7 +889,7 @@@ config SMC911
  
          This driver is also available as a module. The module will be 
          called smc911x.  If you want to compile it as a module, say M 
-         here and read <file:Documentation/modules.txt>
+         here and read <file:Documentation/kbuild/modules.txt>
  
  config NET_VENDOR_RACAL
        bool "Racal-Interlan (Micom) NI cards"
diff --combined drivers/scsi/Kconfig
@@@ -170,7 -170,7 +170,7 @@@ config CHR_DEV_SC
        
          If you want to compile this as a module ( = code which can be
          inserted in and removed from the running kernel whenever you want),
-         say M here and read <file:Documentation/modules.txt> and
+         say M here and read <file:Documentation/kbuild/modules.txt> and
          <file:Documentation/scsi.txt>. The module will be called ch.o.
          If unsure, say N.
        
@@@ -241,12 -241,6 +241,12 @@@ config SCSI_SCAN_ASYN
          You can override this choice by specifying "scsi_mod.scan=sync"
          or async on the kernel's command line.
  
 +config SCSI_WAIT_SCAN
 +      tristate
 +      default m
 +      depends on SCSI
 +      depends on MODULES
 +
  menu "SCSI Transports"
        depends on SCSI
  
@@@ -1200,6 -1194,17 +1200,6 @@@ config SCSI_NCR53C8XX_SYN
          There is no safe option other than using good cabling, right
          terminations and SCSI conformant devices.
  
 -config SCSI_NCR53C8XX_PROFILE
 -      bool "enable profiling"
 -      depends on SCSI_ZALON || SCSI_NCR_Q720
 -      help
 -        This option allows you to enable profiling information gathering.
 -        These statistics are not very accurate due to the low frequency
 -        of the kernel clock (100 Hz on i386) and have performance impact
 -        on systems that use very fast devices.
 -
 -        The normal answer therefore is N.
 -
  config SCSI_NCR53C8XX_NO_DISCONNECT
        bool "not allow targets to disconnect"
        depends on (SCSI_ZALON || SCSI_NCR_Q720) && SCSI_NCR53C8XX_DEFAULT_TAGS=0
@@@ -1329,6 -1334,11 +1329,6 @@@ config SCSI_SIM71
  
          It currently supports Compaq EISA cards and NCR MCA cards
  
 -config 53C700_IO_MAPPED
 -      bool
 -      depends on SCSI_SIM710
 -      default y
 -
  config SCSI_SYM53C416
        tristate "Symbios 53c416 SCSI support"
        depends on ISA && SCSI
@@@ -1639,7 -1649,7 +1639,7 @@@ config OKTAGON_SCS
  
  config ATARI_SCSI
        tristate "Atari native SCSI support"
 -      depends on ATARI && SCSI && BROKEN
 +      depends on ATARI && SCSI
        select SCSI_SPI_ATTRS
        ---help---
          If you have an Atari with built-in NCR5380 SCSI controller (TT,
@@@ -1783,7 -1793,7 +1783,7 @@@ config ZFC
  
            This driver is also available as a module. This module will be
            called zfcp. If you want to compile it as a module, say M here
-           and read <file:Documentation/modules.txt>.
+           and read <file:Documentation/kbuild/modules.txt>.
  
  config SCSI_SRP
        tristate "SCSI RDMA Protocol helper library"
diff --combined drivers/video/Kconfig
@@@ -191,7 -191,7 +191,7 @@@ config FB_ARMCLC
  
          If you want to compile this as a module (=code which can be
          inserted into and removed from the running kernel), say M
-         here and read <file:Documentation/modules.txt>.  The module
+         here and read <file:Documentation/kbuild/modules.txt>.  The module
          will be called amba-clcd.
  
  choice
@@@ -389,10 -389,7 +389,10 @@@ config FB_AR
  
  config FB_ATARI
        bool "Atari native chipset support"
 -      depends on (FB = y) && ATARI && BROKEN
 +      depends on (FB = y) && ATARI
 +      select FB_CFB_FILLRECT
 +      select FB_CFB_COPYAREA
 +      select FB_CFB_IMAGEBLIT
        help
          This is the frame buffer device driver for the builtin graphics
          chipset found in Ataris.
@@@ -1494,7 -1491,7 +1494,7 @@@ config FB_PX
          This driver is also available as a module ( = code which can be
          inserted and removed from the running kernel whenever you want). The
          module will be called pxafb. If you want to compile it as a module,
-         say M here and read <file:Documentation/modules.txt>.
+         say M here and read <file:Documentation/kbuild/modules.txt>.
  
          If unsure, say N.
  
@@@ -1547,7 -1544,7 +1547,7 @@@ config FB_W10
          This driver is also available as a module ( = code which can be
          inserted and removed from the running kernel whenever you want). The
          module will be called w100fb. If you want to compile it as a module,
-         say M here and read <file:Documentation/modules.txt>.
+         say M here and read <file:Documentation/kbuild/modules.txt>.
  
          If unsure, say N.
  
@@@ -1564,7 -1561,7 +1564,7 @@@ config FB_S3C241
          This driver is also available as a module ( = code which can be
          inserted and removed from the running kernel whenever you want). The
          module will be called s3c2410fb. If you want to compile it as a module,
-         say M here and read <file:Documentation/modules.txt>.
+         say M here and read <file:Documentation/kbuild/modules.txt>.
  
          If unsure, say N.
  config FB_S3C2410_DEBUG
diff --combined include/linux/input.h
@@@ -506,7 -506,6 +506,7 @@@ struct input_absinfo 
  #define KEY_VOICEMAIL         0x1ac
  #define KEY_ADDRESSBOOK               0x1ad
  #define KEY_MESSENGER         0x1ae
 +#define KEY_DISPLAYTOGGLE     0x1af   /* Turn display (LCD) on and off */
  
  #define KEY_DEL_EOL           0x1c0
  #define KEY_DEL_EOS           0x1c1
  #define BUS_I2C                       0x18
  #define BUS_HOST              0x19
  #define BUS_GSC                       0x1A
 +#define BUS_ATARI             0x1B
  
  /*
   * Values describing the status of a force-feedback effect
@@@ -915,6 -913,33 +915,6 @@@ struct ff_effect 
  #define BIT(x)        (1UL<<((x)%BITS_PER_LONG))
  #define LONG(x) ((x)/BITS_PER_LONG)
  
 -#define INPUT_KEYCODE(dev, scancode) ((dev->keycodesize == 1) ? ((u8*)dev->keycode)[scancode] : \
 -      ((dev->keycodesize == 2) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
 -
 -#define SET_INPUT_KEYCODE(dev, scancode, val)                 \
 -              ({      unsigned __old;                         \
 -              switch (dev->keycodesize) {                     \
 -                      case 1: {                               \
 -                              u8 *k = (u8 *)dev->keycode;     \
 -                              __old = k[scancode];            \
 -                              k[scancode] = val;              \
 -                              break;                          \
 -                      }                                       \
 -                      case 2: {                               \
 -                              u16 *k = (u16 *)dev->keycode;   \
 -                              __old = k[scancode];            \
 -                              k[scancode] = val;              \
 -                              break;                          \
 -                      }                                       \
 -                      default: {                              \
 -                              u32 *k = (u32 *)dev->keycode;   \
 -                              __old = k[scancode];            \
 -                              k[scancode] = val;              \
 -                              break;                          \
 -                      }                                       \
 -              }                                               \
 -              __old; })
 -
  struct input_dev {
  
        void *private;
        unsigned int keycodemax;
        unsigned int keycodesize;
        void *keycode;
 +      int (*setkeycode)(struct input_dev *dev, int scancode, int keycode);
 +      int (*getkeycode)(struct input_dev *dev, int scancode, int *keycode);
  
        struct ff_device *ff;
  
        unsigned int users;
  
        struct class_device cdev;
 +      union {                 /* temporarily so while we switching to struct device */
 +              struct device *parent;
 +      } dev;
  
        struct list_head        h_list;
        struct list_head        node;
  #error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match"
  #endif
  
+ #if KEY_MIN_INTERESTING != INPUT_DEVICE_ID_KEY_MIN_INTERESTING
+ #error "KEY_MIN_INTERESTING and INPUT_DEVICE_ID_KEY_MIN_INTERESTING do not match"
+ #endif
  #if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX
  #error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match"
  #endif
@@@ -1054,7 -1078,7 +1058,7 @@@ struct input_handler 
        void *private;
  
        void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
 -      struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id);
 +      int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id);
        void (*disconnect)(struct input_handle *handle);
        void (*start)(struct input_handle *handle);
  
@@@ -1084,7 -1108,7 +1088,7 @@@ struct input_handle 
  };
  
  #define to_dev(n) container_of(n,struct input_dev,node)
 -#define to_handler(n) container_of(n,struct input_handler,node);
 +#define to_handler(n) container_of(n,struct input_handler,node)
  #define to_handle(n) container_of(n,struct input_handle,d_node)
  #define to_handle_h(n) container_of(n,struct input_handle,h_node)
  
@@@ -1101,25 -1125,12 +1105,25 @@@ static inline void input_put_device(str
        class_device_put(&dev->cdev);
  }
  
 +static inline void *input_get_drvdata(struct input_dev *dev)
 +{
 +      return dev->private;
 +}
 +
 +static inline void input_set_drvdata(struct input_dev *dev, void *data)
 +{
 +      dev->private = data;
 +}
 +
  int input_register_device(struct input_dev *);
  void input_unregister_device(struct input_dev *);
  
  int input_register_handler(struct input_handler *);
  void input_unregister_handler(struct input_handler *);
  
 +int input_register_handle(struct input_handle *);
 +void input_unregister_handle(struct input_handle *);
 +
  int input_grab_device(struct input_handle *);
  void input_release_device(struct input_handle *);
  
@@@ -1161,8 -1172,6 +1165,8 @@@ static inline void input_sync(struct in
        input_event(dev, EV_SYN, SYN_REPORT, 0);
  }
  
 +void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code);
 +
  static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat)
  {
        dev->absmin[axis] = min;
diff --combined init/main.c
@@@ -82,7 -82,7 +82,7 @@@
  #warning gcc-4.1.0 is known to miscompile the kernel.  A different compiler version is recommended.
  #endif
  
- static int init(void *);
+ static int kernel_init(void *);
  
  extern void init_IRQ(void);
  extern void fork_init(unsigned long);
@@@ -369,8 -369,12 +369,8 @@@ static void __init setup_per_cpu_areas(
        unsigned long nr_possible_cpus = num_possible_cpus();
  
        /* Copy section for each CPU (we discard the original) */
 -      size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES);
 -#ifdef CONFIG_MODULES
 -      if (size < PERCPU_ENOUGH_ROOM)
 -              size = PERCPU_ENOUGH_ROOM;
 -#endif
 -      ptr = alloc_bootmem(size * nr_possible_cpus);
 +      size = ALIGN(PERCPU_ENOUGH_ROOM, PAGE_SIZE);
 +      ptr = alloc_bootmem_pages(size * nr_possible_cpus);
  
        for_each_possible_cpu(i) {
                __per_cpu_offset[i] = ptr - __per_cpu_start;
@@@ -431,7 -435,7 +431,7 @@@ static void __init setup_command_line(c
  static void noinline rest_init(void)
        __releases(kernel_lock)
  {
-       kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND);
+       kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
        numa_default_policy();
        unlock_kernel();
  
@@@ -768,7 -772,7 +768,7 @@@ static int noinline init_post(void
        panic("No init found.  Try passing init= option to kernel.");
  }
  
- static int __init init(void * unused)
+ static int __init kernel_init(void * unused)
  {
        lock_kernel();
        /*
diff --combined scripts/mod/modpost.c
@@@ -55,6 -55,17 +55,17 @@@ void warn(const char *fmt, ...
        va_end(arglist);
  }
  
+ void merror(const char *fmt, ...)
+ {
+       va_list arglist;
+       fprintf(stderr, "ERROR: ");
+       va_start(arglist, fmt);
+       vfprintf(stderr, fmt, arglist);
+       va_end(arglist);
+ }
  static int is_vmlinux(const char *modname)
  {
        const char *myname;
@@@ -333,10 -344,10 +344,10 @@@ void release_file(void *file, unsigned 
        munmap(file, size);
  }
  
- static void parse_elf(struct elf_info *info, const char *filename)
+ static int parse_elf(struct elf_info *info, const char *filename)
  {
        unsigned int i;
-       Elf_Ehdr *hdr = info->hdr;
+       Elf_Ehdr *hdr;
        Elf_Shdr *sechdrs;
        Elf_Sym  *sym;
  
                exit(1);
        }
        info->hdr = hdr;
-       if (info->size < sizeof(*hdr))
-               goto truncated;
+       if (info->size < sizeof(*hdr)) {
+               /* file too small, assume this is an empty .o file */
+               return 0;
+       }
+       /* Is this a valid ELF file? */
+       if ((hdr->e_ident[EI_MAG0] != ELFMAG0) ||
+           (hdr->e_ident[EI_MAG1] != ELFMAG1) ||
+           (hdr->e_ident[EI_MAG2] != ELFMAG2) ||
+           (hdr->e_ident[EI_MAG3] != ELFMAG3)) {
+               /* Not an ELF file - silently ignore it */
+               return 0;
+       }
        /* Fix endianness in ELF header */
        hdr->e_shoff    = TO_NATIVE(hdr->e_shoff);
        hdr->e_shstrndx = TO_NATIVE(hdr->e_shstrndx);
                        = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
                const char *secname;
  
-               if (sechdrs[i].sh_offset > info->size)
-                       goto truncated;
+               if (sechdrs[i].sh_offset > info->size) {
+                       fatal("%s is truncated. sechdrs[i].sh_offset=%u > sizeof(*hrd)=%ul\n", filename, (unsigned int)sechdrs[i].sh_offset, sizeof(*hdr));
+                       return 0;
+               }
                secname = secstrings + sechdrs[i].sh_name;
                if (strcmp(secname, ".modinfo") == 0) {
                        info->modinfo = (void *)hdr + sechdrs[i].sh_offset;
                sym->st_value = TO_NATIVE(sym->st_value);
                sym->st_size  = TO_NATIVE(sym->st_size);
        }
-       return;
-  truncated:
-       fatal("%s is truncated.\n", filename);
+       return 1;
  }
  
  static void parse_elf_finish(struct elf_info *info)
@@@ -581,9 -600,17 +600,17 @@@ static int strrcmp(const char *s, cons
   *   the pattern is identified by:
   *   tosec   = .init.text | .exit.text | .init.data
   *   fromsec = .data
-  *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one
+  *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console
   *
   * Pattern 3:
+  *   Whitelist all references from .pci_fixup* section to .init.text
+  *   This is part of the PCI init when built-in
+  *
+  * Pattern 4:
+  *   Whitelist all refereces from .text.head to .init.data
+  *   Whitelist all refereces from .text.head to .init.text
+  *
+  * Pattern 5:
   *   Some symbols belong to init section but still it is ok to reference
   *   these from non-init sections as these symbols don't have any memory
   *   allocated for them and symbol address and value are same. So even
   *   For ex. symbols marking the init section boundaries.
   *   This pattern is identified by
   *   refsymname = __init_begin, _sinittext, _einittext
+  *
+  * Pattern 6:
+  *   During the early init phase we have references from .init.text to
+  *   .text we have an intended section mismatch - do not warn about it.
+  *   See kernel_init() in init/main.c
+  *   tosec   = .init.text
+  *   fromsec = .text
+  *   atsym = kernel_init
+  *
+  * Pattern 7:
+  *  Logos used in drivers/video/logo reside in __initdata but the
+  *  funtion that references them are EXPORT_SYMBOL() so cannot be
+  *  marker __init. So we whitelist them here.
+  *  The pattern is:
+  *  tosec      = .init.data
+  *  fromsec    = .text*
+  *  refsymname = logo_
+  *
+  * Pattern 8:
+  *  Symbols contained in .paravirtprobe may safely reference .init.text.
+  *  The pattern is:
+  *  tosec   = .init.text
+  *  fromsec  = .paravirtprobe
+  *
   **/
  static int secref_whitelist(const char *modname, const char *tosec,
                            const char *fromsec, const char *atsym,
                "_probe",
                "_probe_one",
                "_console",
 +              "apic_es7000",
                NULL
        };
  
        if (f1 && f2)
                return 1;
  
-       /* Whitelist all references from .pci_fixup section if vmlinux
-        * Whitelist all refereces from .text.head to .init.data if vmlinux
-        * Whitelist all refereces from .text.head to .init.text if vmlinux
-        */
-       if (is_vmlinux(modname)) {
-               if ((strcmp(fromsec, ".pci_fixup") == 0) &&
-                   (strcmp(tosec, ".init.text") == 0))
+       /* Check for pattern 3 */
+       if ((strncmp(fromsec, ".pci_fixup", strlen(".pci_fixup")) == 0) &&
+           (strcmp(tosec, ".init.text") == 0))
+       return 1;
+       /* Check for pattern 4 */
+       if ((strcmp(fromsec, ".text.head") == 0) &&
+               ((strcmp(tosec, ".init.data") == 0) ||
+               (strcmp(tosec, ".init.text") == 0)))
+       return 1;
+       /* Check for pattern 5 */
+       for (s = pat3refsym; *s; s++)
+               if (strcmp(refsymname, *s) == 0)
+                       return 1;
+       /* Check for pattern 6 */
+       if ((strcmp(tosec, ".init.text") == 0) &&
+           (strcmp(fromsec, ".text") == 0) &&
+           (strcmp(refsymname, "kernel_init") == 0))
                return 1;
  
-               if ((strcmp(fromsec, ".text.head") == 0) &&
-                       ((strcmp(tosec, ".init.data") == 0) ||
-                       (strcmp(tosec, ".init.text") == 0)))
+       /* Check for pattern 7 */
+       if ((strcmp(tosec, ".init.data") == 0) &&
+           (strncmp(fromsec, ".text", strlen(".text")) == 0) &&
+           (strncmp(refsymname, "logo_", strlen("logo_")) == 0))
+               return 1;
+       /* Check for pattern 8 */
+       if ((strcmp(tosec, ".init.text") == 0) &&
+           (strcmp(fromsec, ".paravirtprobe") == 0))
                return 1;
  
-               /* Check for pattern 3 */
-               for (s = pat3refsym; *s; s++)
-                       if (strcmp(refsymname, *s) == 0)
-                               return 1;
-       }
        return 0;
  }
  
@@@ -1090,7 -1154,8 +1155,8 @@@ static void read_symbols(char *modname
        struct elf_info info = { };
        Elf_Sym *sym;
  
-       parse_elf(&info, modname);
+       if (!parse_elf(&info, modname))
+               return;
  
        mod = new_module(modname);
  
@@@ -1265,9 -1330,14 +1331,14 @@@ static int add_versions(struct buffer *
                exp = find_symbol(s->name);
                if (!exp || exp->module == mod) {
                        if (have_vmlinux && !s->weak) {
-                               warn("\"%s\" [%s.ko] undefined!\n",
-                                    s->name, mod->name);
-                               err = warn_unresolved ? 0 : 1;
+                               if (warn_unresolved) {
+                                       warn("\"%s\" [%s.ko] undefined!\n",
+                                            s->name, mod->name);
+                               } else {
+                                       merror("\"%s\" [%s.ko] undefined!\n",
+                                                 s->name, mod->name);
+                                       err = 1;
+                               }
                        }
                        continue;
                }
@@@ -1318,6 -1388,7 +1389,7 @@@ static void add_depends(struct buffer *
        buf_printf(b, "__attribute__((section(\".modinfo\"))) =\n");
        buf_printf(b, "\"depends=");
        for (s = mod->unres; s; s = s->next) {
+               const char *p;
                if (!s->module)
                        continue;
  
                        continue;
  
                s->module->seen = 1;
-               buf_printf(b, "%s%s", first ? "" : ",",
-                          strrchr(s->module->name, '/') + 1);
+               if ((p = strrchr(s->module->name, '/')) != NULL)
+                       p++;
+               else
+                       p = s->module->name;
+               buf_printf(b, "%s%s", first ? "" : ",", p);
                first = 0;
        }
        buf_printf(b, "\";\n");