https://bugs.kde.org/show_bug.cgi?id=416682

--- Comment #13 from Krishna <muppakrish...@gmail.com> ---
(In reply to Petar Jovanovic from comment #12)
> (In reply to Krishna from comment #10)
> > Created attachment 126722 [details]
> > mips mmap executable file
> 
> This is not statically linked program.
> 
> $ ldd mips_mmap_exe
>         libssp.so.0 => not found
>         libgcc_s.so.1 => /lib/mipsel-linux-gnu/libgcc_s.so.1 (0x77250000)
>         libc.so.0 => not found
>         libc.so.6 => /lib/mipsel-linux-gnu/libc.so.6 (0x770b0000)
>         /lib/ld-uClibc.so.0 => /lib/ld.so.1 (0x772b0000)
> 
> Can you share the source code of this example and what toolchain to use, how
> to build it, so I can reproduce the issue?

Hi Peter,

Please find the below source code built for shared executable.

Toolchain used: stbgcc-4.5.4-2.9.tar.bz

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>

#define BDBG_UINT64_ARG(x) (unsigned )((x)>>32), (unsigned )(x)
#define BDBG_UINT64_FMT "0x%x%08x"
int main()
{
       void *addr;
        unsigned length=157286400;
        unsigned long long offset=0x0c0200000;

        int fd=open("/tmp/1.txt", O_RDWR | O_CREAT | O_TRUNC);

        addr = mmap(0, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, offset);
        if (addr == MAP_FAILED)
        {
               printf("ERROR:mmap failed: offset " BDBG_UINT64_FMT ", size=%u,
errno=%d\n",
                BDBG_UINT64_ARG(offset), (unsigned)length, errno);
                addr = NULL;
        }
        else
        {
                printf("SUCCESS:mmap  offset:" BDBG_UINT64_FMT " size:%u ->
%p\n",
                BDBG_UINT64_ARG(offset), (unsigned)length, addr);
        }

       return 0;
}

Compile using mips-cc with mentioned options:

<ToolChainPath>/stbgcc-4.5.4-2.9/bin//mipsel-linux-uclibc-gcc -o mmap_krish
mmap.c  -finline-limit=300 -fPIC -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 
-fstack-protector-all -D_FORTIFY_SOURCE=2 -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -DBSTD_CPU_ENDIAN=BSTD_ENDIAN_LITTLE

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to