[gold] alignment of static globals
Christopher Jelesnianski
bielsk1@vt.edu
Tue May 24 22:29:00 GMT 2016
To Whom it May Concern,
I am attempting to align symbols for .text, .rodata, .data, and .bss
through the means of creating my own linker script and passing it to
gold using -T. Symbols are aligned generally as:
. = ALIGN(0x10);
*(.text.cffts1);
. = ALIGN(0x10);
*(.text.main);
for each of their respective sections.
So far most of my symbols have been aligned as desired. However, it
seems static uninitialized global variables are a corner case and do
not follow what is specified in the linker script. It also seems some
have different sizes (and classes? b vs. B) when comparing the NM of
static and non-static.
non-static NM for sample symbols
0000000000424000 0000000000000004 B fftblock
0000000000424004 0000000000000004 B fftblockpad
static NM for sample symbols
0000000050729b35 0000000000000001 b fftblock
0000000050729b38 0000000000000004 b fftblockpad
How can I enforce static uninitialized global variables to follow my
linker script (without just removing the static keyword)?? Can such
constraints be defined in the linker command language, or will I have
to modify the gold linker itself?? Note that the variable is
initialized and used extensively in the program, so it is not being
optimized out.
I have looked at specifying various "__attribute__"'s to the variables
but adding ((used)) or specifying a section did not resolve the
problem.
Many Thanks,
Krzysztof Jelesnianski
More information about the Binutils
mailing list