Hi Jan, >> It was recently pointed out to me that objcopy's --section-alignment >> option does not actually set the alignment of any sections. It just >> sets a field in the PE file format's optional header. This is rather >> confusing for the user. > > Hmm. For one --file-alignment would then want similar treatment, but > afaict that might be more difficult to achieve (sections would need > moving around in the file). Plus I seem to vaguely recall that there > wants to be a certain correlation between section and file alignments > of individual sections, which you may break with such an adjustment. Agreed. I think that I will leave file alignment alone for now. If necessary that can be the subject of a future patch. > ... by doing this adjustment, aren't you at risk of creating overlapping > sections? Should --set-section-alignment= perhaps be limited to > relocatable files? Or better yet - not done at all and just left to the user to fix... So here is a revised patch that does not change the VMAs or LMAs to match new section aligments, but instead issues an error message if they do not match. It also updates the documentation to warn users about this behaviour and about the dangers of changing the VMAs of fully linked binaries. Any further comments ? Cheers Nick