Patchwork [2/2] arch: define appropriate ld emulation values for the MIPS architecture

login
register
mail settings
Submitter Thomas Petazzoni
Date June 5, 2013, 9:59 p.m.
Message ID <1370469543-20677-2-git-send-email-thomas.petazzoni@free-electrons.com>
Download mbox | patch
Permalink /patch/249232/
State Rejected
Headers show

Comments

Thomas Petazzoni - June 5, 2013, 9:59 p.m.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/Config.in.mips | 8 ++++++++
 1 file changed, 8 insertions(+)
Markos Chandras - June 6, 2013, 8:37 a.m.
On 5 June 2013 22:59, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  arch/Config.in.mips | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/arch/Config.in.mips b/arch/Config.in.mips
> index 1454fb4..7f134f8 100644
> --- a/arch/Config.in.mips
> +++ b/arch/Config.in.mips
> @@ -76,3 +76,11 @@ config BR2_GCC_TARGET_ABI
>         default "32"            if BR2_MIPS_OABI32
>         default "n32"           if BR2_MIPS_NABI32
>         default "64"            if BR2_MIPS_NABI64
> +
> +config BR2_LD_TARGET_EMULATION
> +       default "elf64ltsmip"      if BR2_mips64el
> +       default "elf64btsmip"      if BR2_mips64
> +       default "elf32ltsmip"      if BR2_mipsel && !BR2_MIPS_NABI32
> +       default "elf32btsmip"      if BR2_mips && !BR2_MIPS_NABI32
> +       default "elf32ltsmipn32"   if BR2_mipsel && BR2_MIPS_NABI32
> +       default "elf32btsmipn32"   if BR2_mips && BR2_MIPS_NABI32
> --
> 1.8.1.2
>
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

Hi Thomas,

binutils set el32{l,b}smipn32 as default ABI for MIPS64 as well. The
elf64{l,b}tsmip one need to be used only if you want to use the n64
ABI. My opinion is that this patch needs to be changed to something
like this:

 +config BR2_LD_TARGET_EMULATION
 +       default "elf64ltsmip"      if BR2_mips64el && BR2_MIPS_NABI64
 +       default "elf64btsmip"      if BR2_mips64 && BR2_MIPS_NABI64
 +       default "elf32ltsmip"      if BR2_mipsel && !BR2_MIPS_NABI32
 +       default "elf32btsmip"      if BR2_mips && !BR2_MIPS_NABI32
 +       default "elf32ltsmipn32"   if BR2_mipsel && BR2_MIPS_NABI32
 +       default "elf32btsmipn32"   if BR2_mips && BR2_MIPS_NABI32


--
Regards,
Markos Chandras - Gentoo Linux Developer
http://dev.gentoo.org/~hwoarang
Thomas Petazzoni - June 6, 2013, 8:57 a.m.
Dear Markos Chandras,

On Thu, 6 Jun 2013 09:37:41 +0100, Markos Chandras wrote:

> binutils set el32{l,b}smipn32 as default ABI for MIPS64 as well. The
> elf64{l,b}tsmip one need to be used only if you want to use the n64
> ABI. My opinion is that this patch needs to be changed to something
> like this:
> 
>  +config BR2_LD_TARGET_EMULATION
>  +       default "elf64ltsmip"      if BR2_mips64el && BR2_MIPS_NABI64
>  +       default "elf64btsmip"      if BR2_mips64 && BR2_MIPS_NABI64
>  +       default "elf32ltsmip"      if BR2_mipsel && !BR2_MIPS_NABI32
>  +       default "elf32btsmip"      if BR2_mips && !BR2_MIPS_NABI32
>  +       default "elf32ltsmipn32"   if BR2_mipsel && BR2_MIPS_NABI32
>  +       default "elf32btsmipn32"   if BR2_mips && BR2_MIPS_NABI32

Ok, but I'm not too happy with the fact that the BR2_mips64[el]
&& !BR2_MIPS_NABI64 is not being handled here. And according to
arch/Config.in.mips, in fact the n32 ABI does not make sense on 32 bits
BR2_mips and BR2_mipsel.

So, shouldn't this thing be:

config BR2_LD_TARGET_EMULATION
	default "elf64ltsmip"		if  BR2_mips64el && BR2_MIPS_NABI64
	default "elf64btsmip"		if  BR2_mips64   && BR2_MIPS_NABI64
	default "elf32ltsmipn32"	if  BR2_mips64el && BR2_MIPS_NABI32
	default "elf32btsmipn32"	if  BR2_mips64   && BR2_MIPS_NABI32
	default "elf32ltsmip"		if (BR2_mips64el && BR2_MIPS_OABI32) || BR2_mipsel
	default "elf32btsmip"		if (BR2_mips64   && BR2_MIPS_OABI32) || BR2_mips

Thomas
Markos Chandras - June 6, 2013, 9:04 a.m.
On 6 June 2013 09:57, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Markos Chandras,
>
> On Thu, 6 Jun 2013 09:37:41 +0100, Markos Chandras wrote:
>
>> binutils set el32{l,b}smipn32 as default ABI for MIPS64 as well. The
>> elf64{l,b}tsmip one need to be used only if you want to use the n64
>> ABI. My opinion is that this patch needs to be changed to something
>> like this:
>>
>>  +config BR2_LD_TARGET_EMULATION
>>  +       default "elf64ltsmip"      if BR2_mips64el && BR2_MIPS_NABI64
>>  +       default "elf64btsmip"      if BR2_mips64 && BR2_MIPS_NABI64
>>  +       default "elf32ltsmip"      if BR2_mipsel && !BR2_MIPS_NABI32
>>  +       default "elf32btsmip"      if BR2_mips && !BR2_MIPS_NABI32
>>  +       default "elf32ltsmipn32"   if BR2_mipsel && BR2_MIPS_NABI32
>>  +       default "elf32btsmipn32"   if BR2_mips && BR2_MIPS_NABI32
>
> Ok, but I'm not too happy with the fact that the BR2_mips64[el]
> && !BR2_MIPS_NABI64 is not being handled here. And according to
> arch/Config.in.mips, in fact the n32 ABI does not make sense on 32 bits
> BR2_mips and BR2_mipsel.
>
> So, shouldn't this thing be:
>
> config BR2_LD_TARGET_EMULATION
>         default "elf64ltsmip"           if  BR2_mips64el && BR2_MIPS_NABI64
>         default "elf64btsmip"           if  BR2_mips64   && BR2_MIPS_NABI64
>         default "elf32ltsmipn32"        if  BR2_mips64el && BR2_MIPS_NABI32
>         default "elf32btsmipn32"        if  BR2_mips64   && BR2_MIPS_NABI32
>         default "elf32ltsmip"           if (BR2_mips64el && BR2_MIPS_OABI32) || BR2_mipsel
>         default "elf32btsmip"           if (BR2_mips64   && BR2_MIPS_OABI32) || BR2_mips
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com
>

Hi Thomas,

Yes I believe this makes sense

Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>

--
Regards,
Markos Chandras - Gentoo Linux Developer
http://dev.gentoo.org/~hwoarang

Patch

diff --git a/arch/Config.in.mips b/arch/Config.in.mips
index 1454fb4..7f134f8 100644
--- a/arch/Config.in.mips
+++ b/arch/Config.in.mips
@@ -76,3 +76,11 @@  config BR2_GCC_TARGET_ABI
 	default "32"		if BR2_MIPS_OABI32
 	default "n32"		if BR2_MIPS_NABI32
 	default "64"		if BR2_MIPS_NABI64
+
+config BR2_LD_TARGET_EMULATION
+	default "elf64ltsmip"	   if BR2_mips64el
+	default "elf64btsmip"	   if BR2_mips64
+	default "elf32ltsmip"	   if BR2_mipsel && !BR2_MIPS_NABI32
+	default "elf32btsmip"	   if BR2_mips && !BR2_MIPS_NABI32
+	default "elf32ltsmipn32"   if BR2_mipsel && BR2_MIPS_NABI32
+	default "elf32btsmipn32"   if BR2_mips && BR2_MIPS_NABI32