Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mdsetimage doesn't work on aarch64?



For my reasons :-), I’m trying to use crunch’d images on a RAM disk on aarch64.

I noticed that mdsetimage corrupts the kernel file when I run it.


Running “readelf” on the original kernel:

	bash-3.2$ aarch64--netbsd-readelf -h netbsd
	ELF Header:
	  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
	  Class:                             ELF64
	  Data:                              2's complement, little endian
	  Version:                           1 (current)
	  OS/ABI:                            UNIX - System V
	  ABI Version:                       0
	  Type:                              EXEC (Executable file)
	  Machine:                           AArch64
	  Version:                           0x1
	  Entry point address:               0xffffffc000000040
	  Start of program headers:          64 (bytes into file)
	  Start of section headers:          11740736 (bytes into file)
	  Flags:                             0x0
	  Size of this header:               64 (bytes)
	  Size of program headers:           56 (bytes)
	  Number of program headers:         3
	  Size of section headers:           64 (bytes)
	  Number of section headers:         35
	  Section header string table index: 34

Running “objcopy” to verify it’s cool:

	bash-3.2$ aarch64--netbsd-objcopy -S -O binary netbsd netbsd.bin 
	bash-3.2$ 

Running “mdsetimage” to put my FS image into it:

	bash-3.2$ aarch64--netbsd-mdsetimage netbsd ramdisk.fs 
	bash-3.2$ 

Try “objcopy” again — it barfs:

	bash-3.2$ aarch64--netbsd-objcopy -S -O binary netbsd netbsd.bin 
	aarch64--netbsd-objcopy:netbsd: file format not recognized

And “readelf” is also pretty unhappy:

	bash-3.2$ aarch64--netbsd-readelf -h netbsd
	ELF Header:
	  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
	  Class:                             ELF64
	  Data:                              2's complement, little endian
	  Version:                           1 (current)
	  OS/ABI:                            UNIX - System V
	  ABI Version:                       0
	  Type:                              EXEC (Executable file)
	  Machine:                           AArch64
	  Version:                           0x1
	  Entry point address:               0xffffffc000000040
	  Start of program headers:          64 (bytes into file)
	  Start of section headers:          11740736 (bytes into file)
	  Flags:                             0x0
	  Size of this header:               64 (bytes)
	  Size of program headers:           56 (bytes)
	  Number of program headers:         3
	  Size of section headers:           64 (bytes)
	  Number of section headers:         35
	  Section header string table index: 34
	readelf: Warning: Section 0 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 2 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 4 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 6 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 8 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 10 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 12 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 14 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 16 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 18 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 20 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 22 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 24 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 26 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 28 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 30 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 32 has an out of range sh_link value of 1551486736
	readelf: Warning: Section 34 has an out of range sh_link value of 1551486736
	readelf: Error: Reading 1551486736 bytes extends past end of file for string table

Is this a known limitation?  Or did I do something wrong?

Rob



Home | Main Index | Thread Index | Old Index