Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: David Mosberger-Tang <davidm@AZStarNet.COM>
Subject: Re: Problem with modules.
Date: Tue, 8 Oct 1996 08:16:45 -0700	[thread overview]
Message-ID: <199610081516.IAA03732@panda.mosberger> (raw)

>>>>> On Tue, 8 Oct 1996 11:54:12 +0200 (IST), Amit Margalit <amitm@amitpc.iso.dec.com> said:

  Amit> multam-root:/usr/src/linux/modules# insmod vfat
  Amit> insmod: module is 40262 bytes long (expected 34745)
  Amit> insmod: forgot to specify -dc when linking ./vfat.o?

Ah, just yesterday I noticed this myself.  Below is a patch that
should fix the problem.  I'll make a new relese of the BFS insmod
sometime soon.  If somebody had some spare time at hand: how about
looking into porting the regular insmod to the Alpha?  Now that we
have ELF, this might be a worthwhile thing to do.

	--david

--- insmod.c~	Sun Sep  1 08:34:45 1996
+++ insmod.c	Thu Oct  3 23:10:12 1996
@@ -98,8 +100,11 @@
 accum_size (bfd *abfd, asection *sect, PTR obj)
 {
     unsigned long *size = (unsigned long *) obj;
-    *size += (bfd_section_size (abfd, sect) +
-	      (1 << bfd_get_section_alignment(abfd, sect)));
+
+    if (sect->flags & SEC_ALLOC) {
+	*size += (bfd_section_size (abfd, sect) +
+		  (1 << bfd_get_section_alignment(abfd, sect)));
+    }
 }
 
 
@@ -109,10 +114,11 @@
     unsigned long size = bfd_section_size (bfd, sect);
     unsigned long *total_size = (unsigned long *) obj;
 
-    *total_size += size;
     if (sect->flags & SEC_ALLOC) {
 	char * addr;
 
+	*total_size += size;
+
 	addr = code + (bfd_get_section_vma(bfd, sect) - mod_addr);
 	if (addr + size >= code + code_size) {
 	    return;

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

             reply	other threads:[~1996-10-08 15:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-08 15:16 David Mosberger-Tang [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-10-08  9:54 Problem with modules Amit Margalit
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox