Lines Matching refs:section

124  * Align section within PE file
292 * @v section Section
297 asection *section ) {
303 reltab_size = bfd_get_reloc_upper_bound ( bfd, section );
311 numrels = bfd_canonicalize_reloc ( bfd, section, reltab, symtab );
321 * Process section
325 * @v section Section
326 * @ret new New PE section
330 asection *section ) {
334 unsigned long flags = bfd_get_section_flags ( bfd, section );
358 /* Allocate PE section */
359 section_memsz = bfd_section_size ( bfd, section );
365 /* Fill in section header details */
366 strncpy ( ( char * ) new->hdr.Name, section->name,
369 new->hdr.VirtualAddress = bfd_get_section_vma ( bfd, section );
372 /* Fill in section characteristics and update RVA limits */
374 /* .text-type section */
383 /* .data-type section */
392 /* .rodata-type section */
400 /* .bss-type section */
409 eprintf ( "Unrecognised characteristics %#lx for section %s\n",
410 flags, section->name );
414 /* Copy in section contents */
416 if ( ! bfd_get_section_contents ( bfd, section, new->contents,
418 eprintf ( "Cannot read section %s: ", section->name );
462 * @v section Section
467 asection *section, arelent *rel,
471 unsigned long offset = ( bfd_get_section_vma ( bfd, section ) +
474 if ( bfd_is_abs_section ( sym->section ) ) {
500 * Create relocations section
504 * @ret section Relocation section
514 /* Allocate PE section */
520 /* Fill in section header details */
530 /* Copy in section contents */
546 * Create debug section
549 * @ret section Debug section
563 /* Allocate PE section */
570 /* Fill in section header details */
580 /* Create section contents */
613 struct pe_section *section;
618 for ( section = pe_sections ; section ; section = section->next ) {
619 if ( section->hdr.SizeOfRawData ) {
620 section->hdr.PointerToRawData = fpos;
621 fpos += section->hdr.SizeOfRawData;
632 /* Write section headers */
633 for ( section = pe_sections ; section ; section = section->next ) {
634 if ( fwrite ( &section->hdr, sizeof ( section->hdr ),
636 perror ( "Could not write section header" );
642 for ( section = pe_sections ; section ; section = section->next ) {
643 if ( fseek ( pe, section->hdr.PointerToRawData,
646 section->hdr.PointerToRawData,
650 if ( section->hdr.SizeOfRawData &&
651 ( fwrite ( section->contents, section->hdr.SizeOfRawData,
653 eprintf ( "Could not write section %.8s: %s\n",
654 section->hdr.Name, strerror ( errno ) );
671 asection *section;
693 /* For each input section, build an output section and create
696 for ( section = bfd->sections ; section ; section = section->next ) {
698 if ( ! ( bfd_get_section_flags ( bfd, section ) & SEC_ALLOC ) )
700 /* Create output section */
702 section );
704 /* Add relocations from this section */
705 reltab = read_reltab ( bfd, symtab, section );
707 process_reloc ( bfd, section, *rel, &pe_reltab );
711 /* Create the .reloc section */
715 /* Create the .reloc section */