Add --input-type and --output-type to elfedit

binutils/

2010-01-08  H.J. Lu  <hongjiu.lu@intel.com>

	* elfedit.c (input_elf_type): New.
	(output_elf_type): Likewise.
	(elf_type): Likewise.
	(update_elf_header): Support updating ELF file type.
	(command_line_switch): Add OPTION_INPUT_TYPE and
	OPTION_OUTPUT_TYPE.
	(options): Likewise.
	(usage): Add --input-type and --output-type.
	(main): Handle OPTION_INPUT_TYPE and OPTION_OUTPUT_TYPE.  Check
	one of --output-mach and --output-type must be specified.

	* doc/binutils.texi: Document --input-type and --output-type
	for elfedit.

binutils/testsuite/

2010-01-08  H.J. Lu  <hongjiu.lu@intel.com>

	* binutils-all/elfedit-2.d: New.

	* binutils-all/elfedit.exp: Run elfedit-2.
This commit is contained in:
H.J. Lu
2010-01-08 18:50:39 +00:00
parent 28f2482621
commit dd35de7434
6 changed files with 123 additions and 14 deletions

View File

@@ -0,0 +1,15 @@
#PROG: elfedit
#elfedit: --output-type exec
#source: empty.s
#readelf: -h
#name: Update ELF header 2
#target: *-*-linux*
#...
ELF Header:
Magic: 7f 45 4c 46 .*
#...
Version:[ \t]+1 \(current\)
#...
Type:[ \t]+EXEC \(Executable file\)
#...

View File

@@ -29,3 +29,4 @@ if ![is_remote host] {
}
run_dump_test "elfedit-1"
run_dump_test "elfedit-2"