“This is likely happening because the default auto-init glue module for a final 
executable is mentioned in the flags, you either want to pass --auto-init-solib 
if you do need auto-init for bootstrapping a DSO, or --no-auto-init if you 
don't care about auto-bootstrap, along with --ldflags to xeno-config.



http://www.xenomai.org/documentation/xenomai-3/html/man1/xeno-config/index.html“





I see.  After adding either --auto-init-solib or --no-auto-init when compiling 
for library, along with compiler option -fPIC, mmap() still returns -1; (W/out 
-fPIC, munmap() cannot be relocated (similar types of error like before).  
However, errno is 0.  How come errno returns “no error” when mmap() returns 
failure?



Phong.



-----Original Message-----
From: Philippe Gerum [mailto:r...@xenomai.org]
Sent: Wednesday, April 18, 2018 12:58 PM
To: Pham, Phong; xenomai@xenomai.org
Cc: Hillman, Robert
Subject: Re: [Xenomai] mmap when using in conjunction with mapper to retrieve 
memory mapped IO space



On 04/18/2018 09:33 PM, Pham, Phong wrote:

>

> Hi,

>

> Instead of  symbol `mmap' out of range, I now have symbol `malloc' out of 
> range.  I removed  all the -fPIC in my environment.  I have to recompile 
> libc???  I never compiled libc and wants to avoid it.



Of course not.



>

> Any suggestion on

> R_PPC_REL24 relocation at 0x0ffacd3c for symbol `mmap/malloc' out of

> range

>



This is likely happening because the default auto-init glue module for a final 
executable is mentioned in the flags, you either want to pass --auto-init-solib 
if you do need auto-init for bootstrapping a DSO, or --no-auto-init if you 
don't care about auto-bootstrap, along with --ldflags to xeno-config.



http://www.xenomai.org/documentation/xenomai-3/html/man1/xeno-config/index.html



>

> I suggest you add the missing --posix in the LDFLAGS as well.  After all, I 
> copied my app from this very snippet and that's why I get the error.

>



As mentioned in the doc you are referring to, this example is about building a 
trivial VxWorks app, not a POSIX one.



--

Philippe.

Notice: This e-mail and any files transmitted with it may contain Data Device 
Corporation's privileged and proprietary information. It is intended solely for 
the use of the individual or entity to whom it is addressed. If you are not the 
named recipient of this transmission, any disclosure, copying, distribution or 
reliance on the contents of this message is prohibited. If you received this 
e-mail in error, please destroy it and any attached files and notify me 
immediately.
_______________________________________________
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai

Reply via email to