mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* modules, insmod and multiple object files
@ 2001-01-16 11:56 Herrmann, Achim
  2001-01-16 12:04 ` Peter Samuelson
  0 siblings, 1 reply; 2+ messages in thread
From: Herrmann, Achim @ 2001-01-16 11:56 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'

Hi,

I'm new to device driver development under linux and I've a basic question
concerning modules, insmod and multiple object files.

Assume I have two object files "main.o" and "hwaccess.o". 
main.o contains the functions init_module(), cleanup_module() and some other
functions.
hwaccess.o contains some routines to access the hardware. The functions in
main.o depend on the routines existing in hwaccess.o.

main.o was created using language "C": gcc -c main.c -o main.o
and 
hwaccess.o was created using assembler: nasm -f elf hwaccess.asm -o
hwaccess.o

Is there a possibility to combine these two object files, so that I have a
module which is loadable by insmod?


Thanks in advance
Achim



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: modules, insmod and multiple object files
  2001-01-16 11:56 modules, insmod and multiple object files Herrmann, Achim
@ 2001-01-16 12:04 ` Peter Samuelson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Samuelson @ 2001-01-16 12:04 UTC (permalink / raw)
  To: Herrmann, Achim; +Cc: 'linux-kernel@vger.kernel.org'


[Achim Herrmann]
> main.o was created using language "C": gcc -c main.c -o main.o
> and 
> hwaccess.o was created using assembler: nasm -f elf hwaccess.asm -o
> hwaccess.o
> 
> Is there a possibility to combine these two object files, so that I
> have a module which is loadable by insmod?

I'm not very familiar with 'nasm', but assuming it produces regular elf
object files:

  $(LD) -r -o {target}.o main.o hwaccess.o

'$(LD) -r' is used lots of places in kernel makefiles already.  (Too
many places, actually, most of which could and should be automated.
Kai Germaschewski has recently done some work to this end.)

Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-01-16 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-16 11:56 modules, insmod and multiple object files Herrmann, Achim
2001-01-16 12:04 ` Peter Samuelson

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

all inboxes | Powered by JetHome®