This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
output section ALIGN and relocatable links
- From: Sterling Augustine <sterling at tensilica dot com>
- To: binutils at sourceware dot org
- Date: Tue, 15 Nov 2005 10:36:39 -0800
- Subject: output section ALIGN and relocatable links
I have found a bug in the new output section ALIGN feature that was
added with this patch:
http://sourceware.org/ml/binutils-cvs/2005-09/msg00112.html
I tested this against the mainline this morning.
With the following linker script commands, one would expect the output
section "foo" to be aligned to 16, but it won't be.
The output section's alignment is only copied to the output bfd's
alignment in lang_add_section, which is only called when an input
section goes into the output section.
However, in this case, no input section ever appears in the output
section, although the output section does have contents. I am happy to
provide a patch, but after reading the back and forth about zero-sized
sections and alignment, it is unclear to me where the correct place to
fix it is.
jaw > cat t.xr
SECTIONS {
foo : ALIGN(16) {
asymbol = .;
WORD(0xFFFFFF);
}
}
jaw > ld -r -T t.xr random_object_file.o
jaw > objdump -h a.out
...
6 foo 00000010 00000000 00000000 00000034 0
CONTENTS, ALLOC, LOAD, DATA
...