All of lore.kernel.org
 help / color / mirror / Atom feed
* ld trouble
@ 2003-01-29 10:08 Kirill Ratkine
  2003-01-29 15:12 ` hpr
  0 siblings, 1 reply; 2+ messages in thread
From: Kirill Ratkine @ 2003-01-29 10:08 UTC (permalink / raw)
  To: linux-assembly


Hello.

Could somebody explain me where the problem is?

my nasm file:
; ===
section .text
     global _start

msg     db      'Dyna Loading!',0xa
len     equ     $ - msg

_start:
         mov     edx,len
         mov     ecx,msg
         mov     ebx,1
         mov     eax,4
         int     0x80
         mov     eax,1
         int     0x80


my Makefile:
#
cg:     cg.o
         ld -s -o cg cg.o -ldl
cg.o:   cg.asm
         nasm -f elf cg.asm

I added '-ldl' because I'm going to use dlopen and other functions for
shared lib loading. Compilation is Ok but ... system says 'this is non 
executable file' when I try to run it. Why??? (If I delete '-ldl' 
everything is Ok).
Do I need to make my myself loader for '.so', indeed?


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

* Re: ld trouble
  2003-01-29 10:08 ld trouble Kirill Ratkine
@ 2003-01-29 15:12 ` hpr
  0 siblings, 0 replies; 2+ messages in thread
From: hpr @ 2003-01-29 15:12 UTC (permalink / raw)
  To: Kirill Ratkine, linux-assembly

modify the linker command:

	ld --dynamic-linker /lib/ld-linux.so.2 -ldl -s -o cg cg.o


Kirill Ratkine am Mittwoch, 29. Januar 2003 10:08:
> Hello.
>
> Could somebody explain me where the problem is?
>
> my nasm file:
> ; ===
> section .text
>      global _start
>
> msg     db      'Dyna Loading!',0xa
> len     equ     $ - msg
>
> _start:
>          mov     edx,len
>          mov     ecx,msg
>          mov     ebx,1
>          mov     eax,4
>          int     0x80
>          mov     eax,1
>          int     0x80
>
>
> my Makefile:
> #
> cg:     cg.o
>          ld -s -o cg cg.o -ldl
> cg.o:   cg.asm
>          nasm -f elf cg.asm
>
> I added '-ldl' because I'm going to use dlopen and other functions for
> shared lib loading. Compilation is Ok but ... system says 'this is non
> executable file' when I try to run it. Why??? (If I delete '-ldl'
> everything is Ok).
> Do I need to make my myself loader for '.so', indeed?
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-assembly"
> in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2003-01-29 15:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-29 10:08 ld trouble Kirill Ratkine
2003-01-29 15:12 ` hpr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.