How to use arm-none-eabi-objcopy with LTO? Error: plugin needed to handle lto object

Asked by Olivier Martin

I am trying to use objcopy with an archive that has LTO support. But when I use objcopy (to rename a symbol) I have the error:

arm-none-eabi-objcopy: stRDn8eg/world.o: plugin needed to handle lto object

Here are my sources:

--------- hello.c -----------------
const char* hello(void) {
 return "hello";
}

const char* world(void) {
 return "world";
}

--------- world.c -----------------
#include <stdio.h>

const char* hello(void);
const char* world(void);

int print_hello(void) {
 return printf("%s %s\n", hello(), world());
}

My build steps to generate the LTO archive:
arm-none-eabi-gcc -flto -c hello.c
arm-none-eabi-gcc -flto -c world.c
arm-none-eabi-gcc-ar cr hello_world.ar hello.o world.o

And to rename the symbol with objcopy:
arm-none-eabi-objcopy --redefine-sym hello=bonjour hello_world.ar

arm-none-eabi-objcopy: stRDn8eg/hello.o: plugin needed to handle lto object
arm-none-eabi-objcopy: stRDn8eg/world.o: plugin needed to handle lto object

Question information

Language:
English Edit question
Status:
Expired
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Olivier Martin (olivier-martin) said :
#1

The toolchain version I am using is gcc-arm-none-eabi-5_3-2016q1.

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.