This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
My apologies, I forgot to attach the files.
----- Original Message -----
From: Gabriel Marcano <gabemarcano@yahoo.com>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Sent: Wednesday, June 1, 2016 7:23 PM
Subject: arm-none-eabi-gcc 5.3 and LTO, mixing ARM and Thumb instructions
Could someone help me understand this behavior with LTO? I am working with an
ARM cross compiler, arm-none-eabi. I am trying to make the compiler compile two
separate files in different ARM modes/targets, one of them in ARM, one of them
in Thumb. When I compile the two source files without -flto, one with -mthumb
-thumb-interwork, and the other with the same flags just -marm appended as to
override -mthumb, the resulting binary, when dissasembled with objdump, has code
in both modes, and it is rather aparent. When I enable -flto, the resulting
program ends up in a single mode, all of it.
I am attaching a couple of files to this email:
arm.c : The file to be compiled as ARM
main.c : The main function, compiled as Thumb
Makefile : Add -flto to LDFLAGS and CFLAGS to enable lto, remvove it to
disable it.
lto.txt : The arm-none-eabi-objdump dissassembly of the resulting lto
binary.
no-lto.txt : the arm-none-eabi-objdump dissassembly of the resulting binary
without lto.
Is there something obvious about the behavior of LTO that I'm missing? Does it
just generate the final machine code at link time, scrapping the flags used to
compile object files?
Thanks,
Gabriel E. Marcano
int foo(int a, int b)
{
return a + b;
}
Attachment:
lto.txt
Description: Text document
int foo(int a, int b);
int main()
{
return foo(0xDEAD, 0xBEEF);
}
Attachment:
Makefile
Description: Binary data
Attachment:
no-lto.txt
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |