mailing list of musl libc
 help / color / mirror / code / Atom feed
* musl mips n64 dynamic build
@ 2015-10-19  9:21 Mahesh Bodapati
  2015-10-19 11:02 ` Szabolcs Nagy
  2015-10-19 15:18 ` Rich Felker
  0 siblings, 2 replies; 12+ messages in thread
From: Mahesh Bodapati @ 2015-10-19  9:21 UTC (permalink / raw)
  To: Rich Felker; +Cc: musl

[-- Attachment #1: Type: text/plain, Size: 1991 bytes --]

Hi Rich,

I have ported musl libraries for MIPS n64 ABI architecture and I have setup
$gp as

Crt1.s:

*lui           $3,%hi(%neg(%gp_rel(_start)))*

*            daddu
$3,$3,$25                                                /* same in dlsym.s
and pipe.s */*

*            daddiu  $gp,$3,%lo(%neg(%gp_rel(_start)))*

            ld      $4, %got_disp(main)($gp)   # Get main() ..



I didn’t setup $gp as in MIPS o32 ABI as we shouldn’t use _*gp*_disp for
setting up $gp

“The special symbol name _gp_disp, used for relocating the calculation of gp
on entry to a DSO in 32-bit files, is

not supported in ELF-64 or in the new 32-bit ABI. Instead, these relocations
should be composed with

R_MIPS_GPREL applied to an explicit symbol for the entry point of the
subprogram



involves loading the difference between the entry

address of a subprogram s and the runtime gp for establishing gp:

A: lui rx, %hi(%neg(%gp_rel(s)))# load high part of diff

B: daddiu rx, rx, %lo(%neg(%gp_rel(s)))# add low part

C: dadd gp, t9, rx # add to entry address  “



Now I am able to build dynamic n64 musl libraries and n64 dynamic
application but it’s not showing any relocation with it

and execution of application is giving errors like “unsupported relocation
type errors”

$ objdump -R main



a.out:     file format elf64-tradbigmips



DYNAMIC RELOCATION RECORDS (none)



$ ./main

Error relocating libc.so: unsupported relocation type 482431

Error relocating libc.so: unsupported relocation type 482687

Error relocating libc.so: unsupported relocation type 482943

Error relocating libc.so: unsupported relocation type 483199

;

;

;

Segmentation fault



So Can you suggest how can I resolve these errors? I am thinking like
either doing changes in do_mips_reloc(),do_relocs() functions in musl
sources or in usage of relocations.





Thank You In Advance.



Thanks,

Mahesh

[-- Attachment #2: Type: text/html, Size: 7852 bytes --]

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

* Re: musl mips n64 dynamic build
  2015-10-19  9:21 musl mips n64 dynamic build Mahesh Bodapati
@ 2015-10-19 11:02 ` Szabolcs Nagy
  2015-10-19 15:18 ` Rich Felker
  1 sibling, 0 replies; 12+ messages in thread
From: Szabolcs Nagy @ 2015-10-19 11:02 UTC (permalink / raw)
  To: musl; +Cc: Rich Felker

* Mahesh Bodapati <maheshbodapati90@gmail.com> [2015-10-19 14:51:12 +0530]:
> Hi Rich,
> 
> I have ported musl libraries for MIPS n64 ABI architecture and I have setup
> $gp as
> 
> Crt1.s:
> 
> *lui           $3,%hi(%neg(%gp_rel(_start)))*
> 
> *            daddu
> $3,$3,$25                                                /* same in dlsym.s
> and pipe.s */*
> 
> *            daddiu  $gp,$3,%lo(%neg(%gp_rel(_start)))*
> 
>             ld      $4, %got_disp(main)($gp)   # Get main() ..
> 
> 
> 
> I didn???t setup $gp as in MIPS o32 ABI as we shouldn???t use _*gp*_disp for
> setting up $gp
> 
> ???The special symbol name _gp_disp, used for relocating the calculation of gp
> on entry to a DSO in 32-bit files, is
> 
> not supported in ELF-64 or in the new 32-bit ABI. Instead, these relocations
> should be composed with
> 
> R_MIPS_GPREL applied to an explicit symbol for the entry point of the
> subprogram
> 
> 
> 
> involves loading the difference between the entry
> 
> address of a subprogram s and the runtime gp for establishing gp:
> 
> A: lui rx, %hi(%neg(%gp_rel(s)))# load high part of diff
> 
> B: daddiu rx, rx, %lo(%neg(%gp_rel(s)))# add low part
> 
> C: dadd gp, t9, rx # add to entry address  ???
> 
> 
> 
> Now I am able to build dynamic n64 musl libraries and n64 dynamic
> application but it???s not showing any relocation with it
> 
> and execution of application is giving errors like ???unsupported relocation
> type errors???
> 
> $ objdump -R main
> 
> 
> 
> a.out:     file format elf64-tradbigmips
> 
> 
> 
> DYNAMIC RELOCATION RECORDS (none)
> 
> 
> 
> $ ./main
> 
> Error relocating libc.so: unsupported relocation type 482431
> 
> Error relocating libc.so: unsupported relocation type 482687
> 
> Error relocating libc.so: unsupported relocation type 482943
> 
> Error relocating libc.so: unsupported relocation type 483199
> 
> ;

note that these are in libc.so, not main

and the numbers are incrementing by 256, so the last
byte is unchanged 0x7f which means R_MIPS_JUMP_SLOT
on o32 mips.

maybe libc is built to load 64bit elf but itself is
a 32bit elf?

try inspecting readelf -aW of libc.so

> 
> ;
> 
> ;
> 
> Segmentation fault
> 
> 
> 
> So Can you suggest how can I resolve these errors? I am thinking like
> either doing changes in do_mips_reloc(),do_relocs() functions in musl
> sources or in usage of relocations.
> 
> 
> 
> 
> 
> Thank You In Advance.
> 
> 
> 
> Thanks,
> 
> Mahesh


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

* Re: musl mips n64 dynamic build
  2015-10-19  9:21 musl mips n64 dynamic build Mahesh Bodapati
  2015-10-19 11:02 ` Szabolcs Nagy
@ 2015-10-19 15:18 ` Rich Felker
  2015-10-20  9:44   ` Mahesh Bodapati
  1 sibling, 1 reply; 12+ messages in thread
From: Rich Felker @ 2015-10-19 15:18 UTC (permalink / raw)
  To: musl

On Mon, Oct 19, 2015 at 02:51:12PM +0530, Mahesh Bodapati wrote:
> Hi Rich,
> 
> I have ported musl libraries for MIPS n64 ABI architecture and I have setup
> $gp as
> 
> Crt1.s:

crt1.s is obsolete and should not be used for new archs. The benefit
to you is that crt_arch.h (the new way of doing it) is a lot easier to
write. All you need to do is jump to the C entry point _start_c with
the right calling convention for a C function and the first 2 argument
slots containing the original stack pointer and a pointer to _DYNAMIC,
respectively. _start_c can be assumed to be defined in the same source
file.

> *lui           $3,%hi(%neg(%gp_rel(_start)))*
> 
> *            daddu
> $3,$3,$25                                                /* same in dlsym.s
> and pipe.s */*
> 
> *            daddiu  $gp,$3,%lo(%neg(%gp_rel(_start)))*
> 
>             ld      $4, %got_disp(main)($gp)   # Get main() ..

Jumping to main from crt1 is not valid. You need to call
__libc_start_main. But if you use crt_arch.h this part happens
automatically for you.

> I didn’t setup $gp as in MIPS o32 ABI as we shouldn’t use _*gp*_disp for
> setting up $gp
> 
> “The special symbol name _gp_disp, used for relocating the calculation of gp
> on entry to a DSO in 32-bit files, is
> 
> not supported in ELF-64 or in the new 32-bit ABI. Instead, these relocations
> should be composed with
> 
> R_MIPS_GPREL applied to an explicit symbol for the entry point of the
> subprogram

I'm not sure what document you're quoting, but sometimes these things
express assumptions about a particular usage case that don't apply to
what musl is doing. But you should be able to avoid writing this code
anyway.

> involves loading the difference between the entry
> 
> address of a subprogram s and the runtime gp for establishing gp:
> 
> A: lui rx, %hi(%neg(%gp_rel(s)))# load high part of diff
> 
> B: daddiu rx, rx, %lo(%neg(%gp_rel(s)))# add low part
> 
> C: dadd gp, t9, rx # add to entry address  “
> 
> 
> 
> Now I am able to build dynamic n64 musl libraries and n64 dynamic
> application but it’s not showing any relocation with it
> 
> and execution of application is giving errors like “unsupported relocation
> type errors”

Did you make a reloc.h defining the relocation types needed for mips
n64 and mapping them to the generic-reloc names musl uses for them?
See the existing arch/*/reloc.h files. Without these being defined
directly the dynamic linker will not be able to process the
relocations it finds in itself or in the main program or other
libraries.

But without a working crt_arch.h I'm surprised the dynamic linker can
even start at all. Are you sure you're not using the mips32 dynamic
linker? Look at the program headers (using readelf -l) for INTERP.

> $ objdump -R main
> 
> 
> 
> a.out:     file format elf64-tradbigmips
> 
> 
> 
> DYNAMIC RELOCATION RECORDS (none)
> 
> 
> 
> $ ./main
> 
> Error relocating libc.so: unsupported relocation type 482431
> 
> Error relocating libc.so: unsupported relocation type 482687
> 
> Error relocating libc.so: unsupported relocation type 482943
> 
> Error relocating libc.so: unsupported relocation type 483199
> 
> ;
> 
> ;
> 
> ;
> 
> Segmentation fault
> 
> 
> 
> So Can you suggest how can I resolve these errors? I am thinking like
> either doing changes in do_mips_reloc(),do_relocs() functions in musl
> sources or in usage of relocations.

OK, I see what's going wrong here. The invalid relocation types are
being produced by this line in do_mips_relocs:

	rel[1] = sym-p->syms << 8 | R_MIPS_JUMP_SLOT;

That produces a relocation in the elf32 encoding, because I just
assumes mips is elf32 when I wrote it. I believe the 64-bit version
should be:

	rel[1] = sym-p->syms << 32 | R_MIPS_JUMP_SLOT;

Try just making that change and see if it works. If so we can work on
making a clean conditional for 32- vs 64-bit here later.

Rich


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

* Re: musl mips n64 dynamic build
  2015-10-19 15:18 ` Rich Felker
@ 2015-10-20  9:44   ` Mahesh Bodapati
  2015-10-20 10:40     ` Szabolcs Nagy
  0 siblings, 1 reply; 12+ messages in thread
From: Mahesh Bodapati @ 2015-10-20  9:44 UTC (permalink / raw)
  To: Rich Felker; +Cc: musl

[-- Attachment #1: Type: text/plain, Size: 7122 bytes --]

Hi Rich,
Thanks for Your mail
I have ported musl for mips64 arch from porting guide.the list
includes crt_arch.h
and Now I didn't place crt assembly files for mips64 arch.

> That produces a relocation in the elf32 encoding, because I just
> assumes mips is elf32 when I wrote it. I believe the 64-bit version
> should be:
>
>        rel[1] = sym-p->syms << 32 | R_MIPS_JUMP_SLOT;

this change resolved some of the relocation type errors but still i am
getting some relocation type errors.I think these errors are from do_relocs
()
Error relocating libc.so: unsupported relocation type 4611
Error relocating libc.so: unsupported relocation type 4611
Error relocating libc.so: unsupported relocation type 4611
Error relocating libc.so: unsupported relocation type 4611
Error relocating libc.so: unsupported relocation type 4611
Error relocating libc.so: unsupported relocation type 4611
;
;
Error relocating libc.so: unsupported relocation type 4611

the relocation type value is 4611 for all the errors.

> Did you make a reloc.h defining the relocation types needed for mips
> n64 and mapping them to the generic-reloc names musl uses for them?
> See the existing arch/*/reloc.h files. Without these being defined
> directly the dynamic linker will not be able to process the
> relocations it finds in itself or in the main program or other
> libraries

I have ported reloc.h for mips64 as

*bash-3.2$ cat arch/mips64/reloc.h*
#include <endian.h>

#if __BYTE_ORDER == __LITTLE_ENDIAN
#define ENDIAN_SUFFIX "el"
#else
#define ENDIAN_SUFFIX ""
#endif

#ifdef __mips64_soft_float
#define FP_SUFFIX "-sf"
#else
#define FP_SUFFIX ""
#endif

#define LDSO_ARCH "mips64" ENDIAN_SUFFIX FP_SUFFIX

#define TPOFF_K (-0x7000)

*#define REL_SYM_OR_REL  R_MIPS_64         /*I didn't see R_MIPS_REL64  so
It is a composition of R_MIPS_64 and R_MIPS_REL relocations but i didn't
see R_MIPS_REL in elf.h. *
*
 how can i define REL_SYM_OR_REL for mips n64 abi   */*
#define REL_PLT         R_MIPS_JUMP_SLOT
#define REL_COPY        R_MIPS_COPY
#define REL_DTPMOD      R_MIPS_TLS_DTPMOD64
#define REL_DTPOFF      R_MIPS_TLS_DTPREL64
#define REL_TPOFF       R_MIPS_TLS_TPREL64
;
;
#define CRTJMP(pc,sp) __asm__ __volatile__( \
 "move $sp,%1 ; jr %0" : : "r"(pc), "r"(sp) : "memory" ) /* JR Rs  means
jump register PC <- Rs ,jump to the address in the rs*/

#define GETFUNCSYM(fp, sym, got) __asm__ ( \
 ".hidden " #sym "\n" \
 ".set push \n" \
 ".set noreorder \n" \
 " bal 1f \n" \
 "  nop \n" \
 " .gpdword . \n" \
 " .gpdword " #sym " \n" \
 "1:  ld %0, ($ra) \n" \
 " dsubu %0, $ra, %0 \n" \
 " ld $ra, 8($ra) \n" \
 " daddu %0, %0, $ra \n" \
 ".set pop \n" \
 : "=r"(*(fp)) : : "memory", "ra" )




Thanks,
Mahesh


On Mon, Oct 19, 2015 at 8:48 PM, Rich Felker <dalias@libc.org> wrote:

> On Mon, Oct 19, 2015 at 02:51:12PM +0530, Mahesh Bodapati wrote:
> > Hi Rich,
> >
> > I have ported musl libraries for MIPS n64 ABI architecture and I have
> setup
> > $gp as
> >
> > Crt1.s:
>
> crt1.s is obsolete and should not be used for new archs. The benefit
> to you is that crt_arch.h (the new way of doing it) is a lot easier to
> write. All you need to do is jump to the C entry point _start_c with
> the right calling convention for a C function and the first 2 argument
> slots containing the original stack pointer and a pointer to _DYNAMIC,
> respectively. _start_c can be assumed to be defined in the same source
> file.
>
> > *lui           $3,%hi(%neg(%gp_rel(_start)))*
> >
> > *            daddu
> > $3,$3,$25                                                /* same in
> dlsym.s
> > and pipe.s */*
> >
> > *            daddiu  $gp,$3,%lo(%neg(%gp_rel(_start)))*
> >
> >             ld      $4, %got_disp(main)($gp)   # Get main() ..
>
> Jumping to main from crt1 is not valid. You need to call
> __libc_start_main. But if you use crt_arch.h this part happens
> automatically for you.
>
> > I didn’t setup $gp as in MIPS o32 ABI as we shouldn’t use _*gp*_disp for
> > setting up $gp
> >
> > “The special symbol name _gp_disp, used for relocating the calculation
> of gp
> > on entry to a DSO in 32-bit files, is
> >
> > not supported in ELF-64 or in the new 32-bit ABI. Instead, these
> relocations
> > should be composed with
> >
> > R_MIPS_GPREL applied to an explicit symbol for the entry point of the
> > subprogram
>
> I'm not sure what document you're quoting, but sometimes these things
> express assumptions about a particular usage case that don't apply to
> what musl is doing. But you should be able to avoid writing this code
> anyway.
>
> > involves loading the difference between the entry
> >
> > address of a subprogram s and the runtime gp for establishing gp:
> >
> > A: lui rx, %hi(%neg(%gp_rel(s)))# load high part of diff
> >
> > B: daddiu rx, rx, %lo(%neg(%gp_rel(s)))# add low part
> >
> > C: dadd gp, t9, rx # add to entry address  “
> >
> >
> >
> > Now I am able to build dynamic n64 musl libraries and n64 dynamic
> > application but it’s not showing any relocation with it
> >
> > and execution of application is giving errors like “unsupported
> relocation
> > type errors”
>
> Did you make a reloc.h defining the relocation types needed for mips
> n64 and mapping them to the generic-reloc names musl uses for them?
> See the existing arch/*/reloc.h files. Without these being defined
> directly the dynamic linker will not be able to process the
> relocations it finds in itself or in the main program or other
> libraries.
>
> But without a working crt_arch.h I'm surprised the dynamic linker can
> even start at all. Are you sure you're not using the mips32 dynamic
> linker? Look at the program headers (using readelf -l) for INTERP.
>
> > $ objdump -R main
> >
> >
> >
> > a.out:     file format elf64-tradbigmips
> >
> >
> >
> > DYNAMIC RELOCATION RECORDS (none)
> >
> >
> >
> > $ ./main
> >
> > Error relocating libc.so: unsupported relocation type 482431
> >
> > Error relocating libc.so: unsupported relocation type 482687
> >
> > Error relocating libc.so: unsupported relocation type 482943
> >
> > Error relocating libc.so: unsupported relocation type 483199
> >
> > ;
> >
> > ;
> >
> > ;
> >
> > Segmentation fault
> >
> >
> >
> > So Can you suggest how can I resolve these errors? I am thinking like
> > either doing changes in do_mips_reloc(),do_relocs() functions in musl
> > sources or in usage of relocations.
>
> OK, I see what's going wrong here. The invalid relocation types are
> being produced by this line in do_mips_relocs:
>
>         rel[1] = sym-p->syms << 8 | R_MIPS_JUMP_SLOT;
>
> That produces a relocation in the elf32 encoding, because I just
> assumes mips is elf32 when I wrote it. I believe the 64-bit version
> should be:
>
>         rel[1] = sym-p->syms << 32 | R_MIPS_JUMP_SLOT;
>
> Try just making that change and see if it works. If so we can work on
> making a clean conditional for 32- vs 64-bit here later.
>
> Rich
>

[-- Attachment #2: Type: text/html, Size: 17394 bytes --]

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

* Re: musl mips n64 dynamic build
  2015-10-20  9:44   ` Mahesh Bodapati
@ 2015-10-20 10:40     ` Szabolcs Nagy
  2015-10-27  1:30       ` Rich Felker
  0 siblings, 1 reply; 12+ messages in thread
From: Szabolcs Nagy @ 2015-10-20 10:40 UTC (permalink / raw)
  To: musl

* Mahesh Bodapati <maheshbodapati90@gmail.com> [2015-10-20 15:14:04 +0530]:
> Error relocating libc.so: unsupported relocation type 4611
> Error relocating libc.so: unsupported relocation type 4611
> Error relocating libc.so: unsupported relocation type 4611
...
> *#define REL_SYM_OR_REL  R_MIPS_64         /*I didn't see R_MIPS_REL64  so
> It is a composition of R_MIPS_64 and R_MIPS_REL relocations but i didn't
> see R_MIPS_REL in elf.h. *
> *
>  how can i define REL_SYM_OR_REL for mips n64 abi   */*

i don't know what the n64 abi docs says, but this might be a hint:

glibc/sysdeps/mips/dl-machine.h has

#if _MIPS_SIM == _ABI64
    case (R_MIPS_64 << 8) | R_MIPS_REL32:
#else
    case R_MIPS_REL32:
#endif

where R_MIPS_64 << 8 | R_MIPS_REL32 is 4611.


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

* Re: musl mips n64 dynamic build
  2015-10-20 10:40     ` Szabolcs Nagy
@ 2015-10-27  1:30       ` Rich Felker
  2016-01-21 19:11         ` Felix Fietkau
  0 siblings, 1 reply; 12+ messages in thread
From: Rich Felker @ 2015-10-27  1:30 UTC (permalink / raw)
  To: musl; +Cc: Mahesh Bodapati

On Tue, Oct 20, 2015 at 12:40:21PM +0200, Szabolcs Nagy wrote:
> * Mahesh Bodapati <maheshbodapati90@gmail.com> [2015-10-20 15:14:04 +0530]:
> > Error relocating libc.so: unsupported relocation type 4611
> > Error relocating libc.so: unsupported relocation type 4611
> > Error relocating libc.so: unsupported relocation type 4611
> ....
> > *#define REL_SYM_OR_REL  R_MIPS_64         /*I didn't see R_MIPS_REL64  so
> > It is a composition of R_MIPS_64 and R_MIPS_REL relocations but i didn't
> > see R_MIPS_REL in elf.h. *
> > *
> >  how can i define REL_SYM_OR_REL for mips n64 abi   */*
> 
> i don't know what the n64 abi docs says, but this might be a hint:
> 
> glibc/sysdeps/mips/dl-machine.h has
> 
> #if _MIPS_SIM == _ABI64
>     case (R_MIPS_64 << 8) | R_MIPS_REL32:
> #else
>     case R_MIPS_REL32:
> #endif
> 
> where R_MIPS_64 << 8 | R_MIPS_REL32 is 4611.

This seems right. Mahesh, did you get a chance to try this? Does it
help?

Rich


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

* Re: musl mips n64 dynamic build
  2015-10-27  1:30       ` Rich Felker
@ 2016-01-21 19:11         ` Felix Fietkau
  2016-01-22  7:51           ` Mahesh Bodapati
  0 siblings, 1 reply; 12+ messages in thread
From: Felix Fietkau @ 2016-01-21 19:11 UTC (permalink / raw)
  To: musl; +Cc: Mahesh Bodapati

On 2015-10-27 02:30, Rich Felker wrote:
> On Tue, Oct 20, 2015 at 12:40:21PM +0200, Szabolcs Nagy wrote:
>> * Mahesh Bodapati <maheshbodapati90@gmail.com> [2015-10-20 15:14:04 +0530]:
>> > Error relocating libc.so: unsupported relocation type 4611
>> > Error relocating libc.so: unsupported relocation type 4611
>> > Error relocating libc.so: unsupported relocation type 4611
>> ....
>> > *#define REL_SYM_OR_REL  R_MIPS_64         /*I didn't see R_MIPS_REL64  so
>> > It is a composition of R_MIPS_64 and R_MIPS_REL relocations but i didn't
>> > see R_MIPS_REL in elf.h. *
>> > *
>> >  how can i define REL_SYM_OR_REL for mips n64 abi   */*
>> 
>> i don't know what the n64 abi docs says, but this might be a hint:
>> 
>> glibc/sysdeps/mips/dl-machine.h has
>> 
>> #if _MIPS_SIM == _ABI64
>>     case (R_MIPS_64 << 8) | R_MIPS_REL32:
>> #else
>>     case R_MIPS_REL32:
>> #endif
>> 
>> where R_MIPS_64 << 8 | R_MIPS_REL32 is 4611.
> 
> This seems right. Mahesh, did you get a chance to try this? Does it
> help?
Manesh, any update on this? I'm really interested in musl MIPS64 support
for OpenWrt - I'd like to move away from glibc for that arch.
I can also help with testing and bugfixing once this is getting somewhere...

Thanks,

- Felix


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

* Re: musl mips n64 dynamic build
  2016-01-21 19:11         ` Felix Fietkau
@ 2016-01-22  7:51           ` Mahesh Bodapati
  2016-01-22 14:13             ` Szabolcs Nagy
  0 siblings, 1 reply; 12+ messages in thread
From: Mahesh Bodapati @ 2016-01-22  7:51 UTC (permalink / raw)
  To: Felix Fietkau, musl

[-- Attachment #1: Type: text/plain, Size: 1906 bytes --]

yes,This is working.MIPS64 relocation type is a combination of 3 relocation
types each of size 1 byte.

typedef struct
{
  Elf32_Word    r_sym;          /* Symbol index */
  unsigned char r_ssym;         /* Special symbol for 2nd relocation */
  unsigned char r_type3;        /* 3rd relocation type */
  unsigned char r_type2;        /* 2nd relocation type */
  unsigned char r_type1;        /* 1st relocation type */
} _Elf64_Mips_R_Info;

(R_MIPS_64 << 8) | R_MIPS_REL32     is (18 << 8) | 3 = 4611

Thanks,
Mahesh

On Fri, Jan 22, 2016 at 12:41 AM, Felix Fietkau <nbd@openwrt.org> wrote:

> On 2015-10-27 02:30, Rich Felker wrote:
> > On Tue, Oct 20, 2015 at 12:40:21PM +0200, Szabolcs Nagy wrote:
> >> * Mahesh Bodapati <maheshbodapati90@gmail.com> [2015-10-20 15:14:04
> +0530]:
> >> > Error relocating libc.so: unsupported relocation type 4611
> >> > Error relocating libc.so: unsupported relocation type 4611
> >> > Error relocating libc.so: unsupported relocation type 4611
> >> ....
> >> > *#define REL_SYM_OR_REL  R_MIPS_64         /*I didn't see
> R_MIPS_REL64  so
> >> > It is a composition of R_MIPS_64 and R_MIPS_REL relocations but i
> didn't
> >> > see R_MIPS_REL in elf.h. *
> >> > *
> >> >  how can i define REL_SYM_OR_REL for mips n64 abi   */*
> >>
> >> i don't know what the n64 abi docs says, but this might be a hint:
> >>
> >> glibc/sysdeps/mips/dl-machine.h has
> >>
> >> #if _MIPS_SIM == _ABI64
> >>     case (R_MIPS_64 << 8) | R_MIPS_REL32:
> >> #else
> >>     case R_MIPS_REL32:
> >> #endif
> >>
> >> where R_MIPS_64 << 8 | R_MIPS_REL32 is 4611.
> >
> > This seems right. Mahesh, did you get a chance to try this? Does it
> > help?
> Manesh, any update on this? I'm really interested in musl MIPS64 support
> for OpenWrt - I'd like to move away from glibc for that arch.
> I can also help with testing and bugfixing once this is getting
> somewhere...
>
> Thanks,
>
> - Felix
>

[-- Attachment #2: Type: text/html, Size: 3023 bytes --]

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

* Re: musl mips n64 dynamic build
  2016-01-22  7:51           ` Mahesh Bodapati
@ 2016-01-22 14:13             ` Szabolcs Nagy
  2016-01-27  6:47               ` Mahesh Bodapati
  0 siblings, 1 reply; 12+ messages in thread
From: Szabolcs Nagy @ 2016-01-22 14:13 UTC (permalink / raw)
  To: Mahesh Bodapati; +Cc: Felix Fietkau, musl

* Mahesh Bodapati <maheshbodapati90@gmail.com> [2016-01-22 13:21:00 +0530]:
> yes,This is working.MIPS64 relocation type is a combination of 3 relocation
> types each of size 1 byte.
...

ok but what's the status of your mips n64 port in general?

> On Fri, Jan 22, 2016 at 12:41 AM, Felix Fietkau <nbd@openwrt.org> wrote:
> > Manesh, any update on this? I'm really interested in musl MIPS64 support
> > for OpenWrt - I'd like to move away from glibc for that arch.
> > I can also help with testing and bugfixing once this is getting
> > somewhere...


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

* Re: musl mips n64 dynamic build
  2016-01-22 14:13             ` Szabolcs Nagy
@ 2016-01-27  6:47               ` Mahesh Bodapati
  2016-01-28  0:08                 ` Rich Felker
  0 siblings, 1 reply; 12+ messages in thread
From: Mahesh Bodapati @ 2016-01-27  6:47 UTC (permalink / raw)
  To: Mahesh Bodapati, Felix Fietkau, musl

[-- Attachment #1: Type: text/plain, Size: 701 bytes --]

Hi,
We are at the  finishing of MIPS n64 port.

On Fri, Jan 22, 2016 at 7:43 PM, Szabolcs Nagy <nsz@port70.net> wrote:

> * Mahesh Bodapati <maheshbodapati90@gmail.com> [2016-01-22 13:21:00
> +0530]:
> > yes,This is working.MIPS64 relocation type is a combination of 3
> relocation
> > types each of size 1 byte.
> ...
>
> ok but what's the status of your mips n64 port in general?
>
> > On Fri, Jan 22, 2016 at 12:41 AM, Felix Fietkau <nbd@openwrt.org> wrote:
> > > Manesh, any update on this? I'm really interested in musl MIPS64
> support
> > > for OpenWrt - I'd like to move away from glibc for that arch.
> > > I can also help with testing and bugfixing once this is getting
> > > somewhere...
>

[-- Attachment #2: Type: text/html, Size: 1274 bytes --]

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

* Re: musl mips n64 dynamic build
  2016-01-27  6:47               ` Mahesh Bodapati
@ 2016-01-28  0:08                 ` Rich Felker
  2016-01-28 11:29                   ` Mahesh Bodapati
  0 siblings, 1 reply; 12+ messages in thread
From: Rich Felker @ 2016-01-28  0:08 UTC (permalink / raw)
  To: musl

On Wed, Jan 27, 2016 at 12:17:45PM +0530, Mahesh Bodapati wrote:
> Hi,
> We are at the  finishing of MIPS n64 port.

Do you have anything ready for us to review yet? Even if it's not
fully functional and ready to commit now, seeing it early would help
you get some feedback on anything that might need to be changed. It's
going to require some changes anyway to adjust for the atomics
refactorization patch and the bits headers deduplication I'm working
on now, but those are things I'm happy to help with or even do myself.

Rich


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

* Re: musl mips n64 dynamic build
  2016-01-28  0:08                 ` Rich Felker
@ 2016-01-28 11:29                   ` Mahesh Bodapati
  0 siblings, 0 replies; 12+ messages in thread
From: Mahesh Bodapati @ 2016-01-28 11:29 UTC (permalink / raw)
  To: musl, Rich Felker

[-- Attachment #1: Type: text/plain, Size: 696 bytes --]

Thanks Rich,sure.we will start submission of patches from next week.

On Thu, Jan 28, 2016 at 5:38 AM, Rich Felker <dalias@libc.org> wrote:

> On Wed, Jan 27, 2016 at 12:17:45PM +0530, Mahesh Bodapati wrote:
> > Hi,
> > We are at the  finishing of MIPS n64 port.
>
> Do you have anything ready for us to review yet? Even if it's not
> fully functional and ready to commit now, seeing it early would help
> you get some feedback on anything that might need to be changed. It's
> going to require some changes anyway to adjust for the atomics
> refactorization patch and the bits headers deduplication I'm working
> on now, but those are things I'm happy to help with or even do myself.
>
> Rich
>

[-- Attachment #2: Type: text/html, Size: 1124 bytes --]

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

end of thread, other threads:[~2016-01-28 11:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-19  9:21 musl mips n64 dynamic build Mahesh Bodapati
2015-10-19 11:02 ` Szabolcs Nagy
2015-10-19 15:18 ` Rich Felker
2015-10-20  9:44   ` Mahesh Bodapati
2015-10-20 10:40     ` Szabolcs Nagy
2015-10-27  1:30       ` Rich Felker
2016-01-21 19:11         ` Felix Fietkau
2016-01-22  7:51           ` Mahesh Bodapati
2016-01-22 14:13             ` Szabolcs Nagy
2016-01-27  6:47               ` Mahesh Bodapati
2016-01-28  0:08                 ` Rich Felker
2016-01-28 11:29                   ` Mahesh Bodapati

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).