Skip to contentSkip to conversation

ARC: Explicitly specify OUTPUT_FORMAT in the linker script

PATCH In review Alexey Brodkin 2 participants 3 messages Jun 1, 2018 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARC: Explicitly specify OUTPUT_FORMAT in the linker script

It might be a good idea to explicitly specify BFD format depending on -EB/-EL option passed to the linker and not rely on default behavior as we have now.

Description of the OUTPUT_FORMAT command is available here:
https://sourceware.org/binutils/docs/ld/Format-Commands.html#Format-Commands

Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Cupertino Miranda <cmiranda at synopsys.com>
Cc Claudiu Zissulescu <claziss at synopsys.com>
---
 arch/arc/kernel/vmlinux.lds.S | 1 +
 1 file changed, 1 insertion(+)
arch/arc/kernel/vmlinux.lds.S +1 -0
index f35ed578e007..0a1affc56d76 100644
@@ -11,6 +11,7 @@
 #include <asm/page.h>
 #include <asm/thread_info.h>
 
+OUTPUT_FORMAT("elf32-littlearc", "elf32-bigarc", "elf32-littlearc")
 OUTPUT_ARCH(arc)
 ENTRY(res_service)
 
Signature · 1 line
2.16.2
#1 lore raw
Quoted 3 lines · Alexey Brodkin

It might be a good idea to explicitly specify BFD format depending on -EB/-EL option passed to the linker and not rely on default behavior as we have now.

What exactly is the problem we are trying to solve here ?
Is this preventive or did you run into something - if latter can u explain it here please ?

Quoted 22 lines

Description of the OUTPUT_FORMAT command is available here:
https://sourceware.org/binutils/docs/ld/Format-Commands.html#Format-Commands

Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Cupertino Miranda <cmiranda at synopsys.com>
Cc Claudiu Zissulescu <claziss at synopsys.com>
---
 arch/arc/kernel/vmlinux.lds.S | 1 +
 1 file changed, 1 insertion(+)
arch/arc/kernel/vmlinux.lds.S +1 -0
index f35ed578e007..0a1affc56d76 100644
@@ -11,6 +11,7 @@
 #include <asm/page.h>
 #include <asm/thread_info.h>
 
+OUTPUT_FORMAT("elf32-littlearc", "elf32-bigarc", "elf32-littlearc")
 OUTPUT_ARCH(arc)
 ENTRY(res_service)
 
#2 lore raw

Hi Vineet,

Quoted 8 lines · Vineet Gupta
Quoted 3 lines · Alexey Brodkin

It might be a good idea to explicitly specify BFD format depending on -EB/-EL option passed to the linker and not rely on default behavior as we have now.

What exactly is the problem we are trying to solve here ?
Is this preventive or did you run into something - if latter can u explain it here please ?

Right, this is preventive patch.
As Claus mentioned that's good to have this explicit information for BFD but otherwise there's no clear requirement or even recommendation on OUTPUT_FORMAT usage so that might not be needed.

-Alexey