cancel
Showing results for 
Search instead for 
Did you mean: 

Elf file and relative paths

Feanoer
Associate II

I'm working on the STM32WL55 Nucleo-64, starting from the LoRaWAN_End_Node.

I performed a hexdump and noticed that the ELF file generated at the end of the compilation process contains a significant recurrence of absolute paths, as shown in the picture below.

Feanoer_0-1720519174226.png

 

I tried using the menu "Properties->Path and Symbols->Includes" to include all the paths through the workspace to avoid the absolute paths.

 

Feanoer_1-1720520553204.png

 

What did I do wrong? How can I generate an ELF file containing only relative paths?

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

You can strip all debug information from ELF file (but it will be awkward to debug). The first 4 include directories come from the .spec file of the compiler.

 

View solution in original post

6 REPLIES 6
STTwo-32
ST Employee

Hello @Feanoer 

I suggest you take a look at this post.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Pavel A.
Evangelist III

@Feanoer In your screenshot the paths are actually absolute. Because, "/${ProjName}" is a "workspace path".

If these absolute paths are not contained in binary image (are debug information only) - not a problem at all.

 

Ok, thank you. I have corrected the paths in the figure, and now they are indeed no longer called in the .ELF file. The only absolute references still present refer to the Debug folder

Feanoer_0-1720700901673.png

 and the first 4 external includes, 

Feanoer_3-1720701427462.png

 

which actually do not appear in 'Path and Symbol.'

Feanoer_2-1720701149348.png

Is there a way to remove these last references?"

 

Pavel A.
Evangelist III

You can strip all debug information from ELF file (but it will be awkward to debug). The first 4 include directories come from the .spec file of the compiler.

 

What is a way to remove those absolute paths that refer to the debug folders? I'm looking in the project properties, but I still can't avoid them.

Pavel A.
Evangelist III

If the absolute paths indeed are in the debug information of the .elf - just run strip --strip-debug on it.

If the paths are in strings (like due to using __FILE__ macro), it will be more complicated.