elf.lst

来自「au1200下的boot代码」· LST 代码 · 共 1,403 行 · 第 1/5 页

LST
1,403
字号
 235:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 					if(!elfRead2(address, scnhdr[i].sh_size, scnhdr[i].sh_offset))
 236:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 						return 0;
 237:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 238:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			case SHT_SYMTAB:
 239:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 240:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			case SHT_STRTAB:
 241:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 242:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			case SHT_RELA:
 243:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 244:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			case SHT_NOBITS:
 245:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				address = (char *)scnhdr[i].sh_addr;
 246:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				if(address && scnhdr[i].sh_size)
 247:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 					memFill(address, scnhdr[i].sh_size, 0x00);	//zero memory
 248:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 249:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			default:
 250:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				/* unknown section type */
 251:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 252:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		}
 253:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	}
 254:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** }
 255:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 
 256:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** void displaySectionHeader(Elf32_Shdr* header)
 257:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** {
 244              		.loc 1 257 0 245              		.frame	$sp,24,$31		# vars= 0, regs= 2/0, args= 16, gp= 0 246              		.mask	0x80010000,-4 247              		.fmask	0x00000000,0 248              		.set	noreorder 249              		.set	nomacro 250              		 251 0138 E8FFBD27 		addiu	$sp,$sp,-24 252              	$LCFI5: 253 013c 1400BFAF 		sw	$31,20($sp) 254              	$LCFI6: 255 0140 1000B0AF 		sw	$16,16($sp) 256              	$LCFI7: 258:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	printf(" sh_name:    %08X\n",header->sh_name);
 257              		.loc 1 258 0GAS LISTING /tmp/ccSF7Vky.s 			page 11 258 0144 0000858C 		lw	$5,0($4) 259              		.loc 1 257 0 260 0148 21808000 		move	$16,$4 261              		.loc 1 258 0 262 014c 0000043C 		lui	$4,%hi($LC3) 263 0150 0000000C 		jal	printf 264 0154 00008424 		addiu	$4,$4,%lo($LC3) 265              	 259:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	printf(" sh_type:    %08X\n",header->sh_type);
 266              		.loc 1 259 0 267 0158 0400058E 		lw	$5,4($16) 268 015c 0000043C 		lui	$4,%hi($LC4) 269 0160 0000000C 		jal	printf 270 0164 00008424 		addiu	$4,$4,%lo($LC4) 271              	 260:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	printf(" sh_flags:   %08X\n",header->sh_flags);
 272              		.loc 1 260 0 273 0168 0800058E 		lw	$5,8($16) 274 016c 0000043C 		lui	$4,%hi($LC5) 275 0170 0000000C 		jal	printf 276 0174 00008424 		addiu	$4,$4,%lo($LC5) 277              	 261:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	printf(" sh_addr:    %08X\n",header->sh_addr);
 278              		.loc 1 261 0 279 0178 0C00058E 		lw	$5,12($16) 280 017c 0000043C 		lui	$4,%hi($LC6) 281 0180 0000000C 		jal	printf 282 0184 00008424 		addiu	$4,$4,%lo($LC6) 283              	 262:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	printf(" sh_offset:  %08X\n",header->sh_offset);
 284              		.loc 1 262 0 285 0188 1000058E 		lw	$5,16($16) 286 018c 0000043C 		lui	$4,%hi($LC7) 287 0190 0000000C 		jal	printf 288 0194 00008424 		addiu	$4,$4,%lo($LC7) 289              	 263:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	printf(" sh_size:    %08X\n",header->sh_size);
 290              		.loc 1 263 0 291 0198 1400058E 		lw	$5,20($16) 292 019c 0000043C 		lui	$4,%hi($LC8) 293 01a0 0000000C 		jal	printf 294 01a4 00008424 		addiu	$4,$4,%lo($LC8) 295              	 264:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	printf(" sh_link:    %08X\n",header->sh_link);
 296              		.loc 1 264 0 297 01a8 1800058E 		lw	$5,24($16) 298 01ac 0000043C 		lui	$4,%hi($LC9) 299 01b0 0000000C 		jal	printf 300 01b4 00008424 		addiu	$4,$4,%lo($LC9) 301              	 265:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	printf(" sh_info:    %08X\n",header->sh_info);
 302              		.loc 1 265 0 303 01b8 1C00058E 		lw	$5,28($16) 304 01bc 0000043C 		lui	$4,%hi($LC10) 305 01c0 0000000C 		jal	printf 306 01c4 00008424 		addiu	$4,$4,%lo($LC10) 307              	GAS LISTING /tmp/ccSF7Vky.s 			page 12 266:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	printf(" sh_addalgn: %08X\n",header->sh_addralign);
 308              		.loc 1 266 0 309 01c8 2000058E 		lw	$5,32($16) 310 01cc 0000043C 		lui	$4,%hi($LC11) 311 01d0 0000000C 		jal	printf 312 01d4 00008424 		addiu	$4,$4,%lo($LC11) 313              	 267:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	printf(" sh_entsize: %08X\n",header->sh_entsize);
 314              		.loc 1 267 0 315 01d8 2400058E 		lw	$5,36($16) 316 01dc 0000043C 		lui	$4,%hi($LC12) 317 01e0 1400BF8F 		lw	$31,20($sp) 318 01e4 1000B08F 		lw	$16,16($sp) 319 01e8 00008424 		addiu	$4,$4,%lo($LC12) 320 01ec 00000008 		j	printf 321 01f0 1800BD27 		addiu	$sp,$sp,24 322              	 323              		.set	macro 324              		.set	reorder 325              	$LFE7: 326              		.end	displaySectionHeader 327              		.align	2 328              		.ent	elfReadSectionHeader 329              		.type	elfReadSectionHeader, @function 330              	elfReadSectionHeader: 331              	$LFB8: 268:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** }
 269:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 
 270:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** /********************************************************************/
 271:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** static int
 272:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** elfReadSectionHeader()
 273:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** {
 332              		.loc 1 273 0 333              		.frame	$sp,64,$31		# vars= 8, regs= 10/0, args= 16, gp= 0 334              		.mask	0xc0ff0000,-4 335              		.fmask	0x00000000,0 336              		.set	noreorder 337              		.set	nomacro 338              		 339 01f4 C0FFBD27 		addiu	$sp,$sp,-64 340              	$LCFI8: 341 01f8 2800B4AF 		sw	$20,40($sp) 342              	$LCFI9: 274:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	int i;
 275:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	char c;
 276:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 
 277:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	scn_foffset = (uint32)~0;
 278:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	symndx = -1;
 279:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	strndx = -1;
 280:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 
 281:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	if (!elfhdr.e_shnum)
 343              		.loc 1 281 0 344 01fc 0000143C 		lui	$20,%hi(elfhdr) 345              		.loc 1 273 0 346 0200 3000B6AF 		sw	$22,48($sp) 347              	$LCFI10: 348 0204 2400B3AF 		sw	$19,36($sp)GAS LISTING /tmp/ccSF7Vky.s 			page 13 349              	$LCFI11: 350 0208 2000B2AF 		sw	$18,32($sp) 351              	$LCFI12: 352 020c 3C00BFAF 		sw	$31,60($sp) 353              	$LCFI13: 354 0210 3800BEAF 		sw	$fp,56($sp) 355              	$LCFI14: 356 0214 3400B7AF 		sw	$23,52($sp) 357              	$LCFI15: 358 0218 2C00B5AF 		sw	$21,44($sp) 359              	$LCFI16: 360 021c 1C00B1AF 		sw	$17,28($sp) 361              	$LCFI17: 362 0220 1800B0AF 		sw	$16,24($sp) 363              	$LCFI18: 364              		.loc 1 281 0 365 0224 0C008426 		addiu	$4,$20,%lo(elfhdr) 366 0228 30008394 		lhu	$3,48($4) 367              		.loc 1 277 0 368 022c FFFF0224 		li	$2,-1			# 0xffffffffffffffff 369 0230 0000123C 		lui	$18,%hi(scn_foffset) 370              		.loc 1 278 0 371 0234 0000133C 		lui	$19,%hi(symndx) 372              		.loc 1 279 0 373 0238 0000163C 		lui	$22,%hi(strndx) 374 023c 0800C2AE 		sw	$2,%lo(strndx)($22) 375              		.loc 1 277 0 376 0240 F00442AE 		sw	$2,%lo(scn_foffset)($18) 377              		.loc 1 278 0 378 0244 040062AE 		sw	$2,%lo(symndx)($19) 282:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		return 0;
 379              		.loc 1 282 0 380              		.loc 1 281 0 381 0248 42006010 		beq	$3,$0,$L10 382 024c 21280000 		move	$5,$0 383              	 283:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 
 284:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	for(i = elfBytesRead; i < elfhdr.e_shoff; ++i)	//seek to header
 384              		.loc 1 284 0 385 0250 0000033C 		lui	$3,%hi(elfBytesRead) 386 0254 0000708C 		lw	$16,%lo(elfBytesRead)($3) 387 0258 2000828C 		lw	$2,32($4) 388 025c 2B100202 		sltu	$2,$16,$2 285:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		if(!elfRead(&c, 1))
 286:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			return 0;
 287:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 
 288:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	for (i = 0; i < elfhdr.e_shnum; ++i)
 389              		.loc 1 288 0 390              		.loc 1 284 0 391 0260 0D004010 		beq	$2,$0,$L48 392 0264 0C008326 		addiu	$3,$20,%lo(elfhdr) 393              	 394 0268 21888000 		move	$17,$4 395              		.loc 1 285 0 396 026c 1000A427 		addiu	$4,$sp,16 397              	$L49: 398 0270 01000524 		li	$5,1			# 0x1GAS LISTING /tmp/ccSF7Vky.s 			page 14 399              		.loc 1 284 0 400              		.loc 1 285 0 401 0274 0000000C 		jal	elfRead 402 0278 01001026 		addiu	$16,$16,1 403              	 289:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	{
 290:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		elfRead(&scnhdr[i], sizeof(Elf32_Shdr));
 291:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** //		displaySectionHeader(&scnhdr[i]);
 292:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		switch (scnhdr[i].sh_type)
 293:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		{
 294:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			case SHT_NULL:
 295:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 296:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			case SHT_PROGBITS:
 297:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				if (scnhdr[i].sh_offset < scn_foffset)
 298:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 					scn_foffset = scnhdr[i].sh_offset;
 299:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 300:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			case SHT_SYMTAB:
 301:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				if (symndx < 0)
 302:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 					 symndx = i;
 303:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				if (scnhdr[i].sh_offset < scn_foffset)
 304:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 					scn_foffset = scnhdr[i].sh_offset;
 305:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 306:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			case SHT_STRTAB:
 307:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				if ((strndx < 0) && (i != elfhdr.	e_shstrndx))
 308:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 					strndx = i;
 309:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				if (scnhdr[i].sh_offset < scn_foffset)
 310:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 					scn_foffset = scnhdr[i].sh_offset;
 311:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 312:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			case SHT_RELA:
 313:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 314:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			case SHT_NOBITS:
 315:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 316:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 			default:
 317:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				/* unknown section type */
 318:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 				break;
 319:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		}
 320:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	}
 321:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 
 322:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	/*
 323:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	 * Check for symbol table existence and for string
 324:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	 * table existence AFTER symbol table.
 325:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	 */
 326:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	if ((symndx < 0) || (strndx < 0))
 327:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	{
 328:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		return FALSE;
 329:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	}
 330:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 
 331:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	if (symndx < strndx)
 332:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	{
 333:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		/*
 334:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		 * The symbol table entries MUST exist before the string
 335:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		 * entries, or else this information comes too late.
 336:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		 * (Unless you want to do a third pass!??  Not!
 337:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		 */
 338:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 		return TRUE;
 339:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	}
 340:/mnt/hgfs/boot/booter/source/applications/booter/elf.c **** 	else
GAS LISTING /tmp/ccSF7Vky.s 			page 15

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?