main.c (338414) | main.c (340309) |
---|---|
1/*- 2 * Copyright (c) 2007-2013 Kai Wang 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 358 unchanged lines hidden (view full) --- 367 * Create symbol table. Symbols are filtered or stripped according to 368 * command line args specified by user, and later updated for the new 369 * layout of sections in the output object. 370 */ 371 if ((ecp->flags & SYMTAB_EXIST) != 0) 372 create_symtab(ecp); 373 374 /* | 1/*- 2 * Copyright (c) 2007-2013 Kai Wang 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 358 unchanged lines hidden (view full) --- 367 * Create symbol table. Symbols are filtered or stripped according to 368 * command line args specified by user, and later updated for the new 369 * layout of sections in the output object. 370 */ 371 if ((ecp->flags & SYMTAB_EXIST) != 0) 372 create_symtab(ecp); 373 374 /* |
375 * Write the underlying ehdr. Note that it should be called 376 * before elf_setshstrndx() since it will overwrite e->e_shstrndx. 377 */ 378 if (gelf_update_ehdr(ecp->eout, &oeh) == 0) 379 errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", 380 elf_errmsg(-1)); 381 382 /* |
|
375 * First processing of output sections: at this stage we copy the 376 * content of each section from input to output object. Section 377 * content will be modified and printed (mcs) if need. Also content of 378 * relocation section probably will be filtered and updated according 379 * to symbol table changes. 380 */ 381 copy_content(ecp); 382 | 383 * First processing of output sections: at this stage we copy the 384 * content of each section from input to output object. Section 385 * content will be modified and printed (mcs) if need. Also content of 386 * relocation section probably will be filtered and updated according 387 * to symbol table changes. 388 */ 389 copy_content(ecp); 390 |
383 /* 384 * Write the underlying ehdr. Note that it should be called 385 * before elf_setshstrndx() since it will overwrite e->e_shstrndx. 386 */ 387 if (gelf_update_ehdr(ecp->eout, &oeh) == 0) 388 errx(EXIT_FAILURE, "gelf_update_ehdr() failed: %s", 389 elf_errmsg(-1)); 390 | |
391 /* Generate section name string table (.shstrtab). */ 392 set_shstrtab(ecp); 393 394 /* 395 * Second processing of output sections: Update section headers. 396 * At this stage we set name string index, update st_link and st_info 397 * for output sections. 398 */ --- 1207 unchanged lines hidden --- | 391 /* Generate section name string table (.shstrtab). */ 392 set_shstrtab(ecp); 393 394 /* 395 * Second processing of output sections: Update section headers. 396 * At this stage we set name string index, update st_link and st_info 397 * for output sections. 398 */ --- 1207 unchanged lines hidden --- |