https://sourceware.org/bugzilla/show_bug.cgi?id=24942
Bug ID: 24942 Summary: objcopy: Add option for setting section alignment Product: binutils Version: 2.33 (HEAD) Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: profclonk at gmail dot com Target Milestone: --- Created attachment 11965 --> https://sourceware.org/bugzilla/attachment.cgi?id=11965&action=edit Patch for adding --set-section-alignment When using the old trickĀ¹ of using objcopy to convert arbitrary binary files into ELF (".o") files for including e.g. pictures or fonts into program memory, objcopy currently always sets the alignment of the produced ELF section to "1". When linking this file, the contained binary data can end up at an address that is not properly aligned, which might render it inaccessible for word-wise access or even DMA (on embedded targets). Therefore, I would like to propose adding a command line option to objcopy to set the alignment of the produced section. Please see the attached git patch file for a possible implementation. It adds an option "--set-section-alignment <name>=<align>" that works much like "--set-section-flags", but expects a simple integer as "<align>". The specified alignment will override the alignment of the input section (if any). Could this be included in the official binutils code? 1: https://mcuoneclipse.com/2018/01/27/converting-a-raw-binary-file-into-an-elf-dwarf-file-for-loading-and-debugging/ -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils