Change objcopy's --set-section-alignment option to take a byte alignment value rather than a power of two alignment value.

PR 24942
	* objcopy.c (copy_usage): Update description of
	--set-section-alignment.
	(copy_main): Interpret numeric argument of --set-section-alignment
	as a byte alignment, not a power of two alignment.
	* doc/binutils.texi: Update description of
	--set-section-alignment.
	* testsuite/binutils-all/set-section-alignment.d: New test.
	* testsuite/binutils-all/objcopy.exp: Run the new test.
This commit is contained in:
Nick Clifton
2019-10-02 11:55:02 +01:00
parent c292080e11
commit de4859eacb
5 changed files with 47 additions and 11 deletions

View File

@ -1310,3 +1310,5 @@ proc objcopy_remove_relocations_from_executable { } {
objcopy_remove_relocations_from_executable
run_dump_test "pr23633"
run_dump_test "set-section-alignment"

View File

@ -0,0 +1,9 @@
#source: pr23633.s
#PROG: objcopy
#objcopy: --set-section-alignment .text=16
#objdump: --section-headers
#notarget: *-*-*aout *-*-*coff *-*-cygwin* *-*-darwin *-*-mingw* *-*-go32 *-*-*pe hppa*-*-hpux* ns32k-*-* powerpc-*-aix* rs6000-*-* rx-*-* *-*-vms
#...
.*\.text.*2\*\*4
#pass