The .data.rel.* of local variable is not generated while compile option -fpic -msingle-pic-base -mno-pic-data-is-text-relative are set
Bug #1523315 reported by
Justin
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
New
|
Undecided
|
Unassigned |
Bug Description
Here is the code to reproduce the problem.
uint32 * global_var[] = [ "123", "234", "456" ];
void function (void) {
uint32 * local_var[] = [ "123", "234", "456" ];
....
}
After compiling code with option -msingle-pic-base -mno-pic-
The data.rel.global_var is generated in object file as expected.
But the data.rel.local_var is not !!!!!
So I did not know how to relocate the data.rel.local_var during run-time.
The problem may lead to relocation fail for local_var[].
BR, Justin
description: | updated |
description: | updated |
To post a comment you must log in.
Hi Justin,
I am not sure what you are trying to achieve here. The 'local_var' variable as the name points out is a local variable and will thus end up on the stack. The variable itself can not be relocated, however the values used to initialize it "123", "234", "456" will be in .rodata and maybe these are the ones you are trying to relocate?
Can you provide us with a working example (the code you posted does not compile) and the command line you used to compile such that we can try to reproduce your problem.
Cheers,
Andre