Changeset 14946


Ignore:
Timestamp:
Aug 19, 2011, 8:56:05 PM (9 years ago)
Author:
gb
Message:

Add an empty section named ".gnu.prelink_undo"; the 'perf' profiler uses
the presence of a section with that name to determine that an object
file has been "prelinked", and we basically want it to view a CCL image
(with sections at fixed addresses) that way.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/library/elf.lisp

    r14230 r14946  
    375375         (strings-section (new-elf-section object))
    376376         (shstrtab-section (new-elf-section object))
     377         (prelink-id-section (new-elf-section object))
    377378         (section-names (make-elf-string-table))
    378379         (lisp-section-index (elf-section-index lisp-section))
     
    381382         (symbols-section-header (elf-section-header-for-section object symbols-section))
    382383         (strings-section-header (elf-section-header-for-section object strings-section))
    383          (shstrtab-section-header (elf-section-header-for-section object shstrtab-section)))
     384         (shstrtab-section-header (elf-section-header-for-section object shstrtab-section))
     385         (prelink-id-section-header (elf-section-header-for-section object prelink-id-section)))
    384386   
    385387    (setf (pref file-header #+64-bit-target :<E>lf64_<E>hdr.e_shstrndx
     
    420422          (pref shstrtab-section-header #+64-bit-target :<E>lf64_<S>hdr.sh_flags
    421423                #+32-bit-target :<E>lf32_<S>hdr.sh_flags) (logior #$SHF_STRINGS #$SHF_ALLOC))
     424    ;; The perf profiler recognizes prelinked libraries by the presence of
     425    ;; some section with this exact name; it doesn't care about the section's
     426    ;; contents or other attributes, currently.
     427    ;; We want that profiler to treat the lisp section as if it was prelinked.
     428    (setf (pref prelink-id-section-header #+64-bit-target :<E>lf64_<S>hdr.sh_name
     429                #+32-bit-target :<E>lf32_<S>hdr.sh_name) (elf-register-string ".gnu.prelink_undo" section-names))
     430   
    422431    (elf-make-empty-data-for-section object lisp-section (ash (- (%fixnum-ref *readonly-area* target::area.active) (%fixnum-ref *readonly-area* target::area.low) )target::fixnumshift))
    423432    (elf-init-section-data-from-string-table object strings-section (elf-symbol-table-strings symbols))
    424433    (elf-init-section-data-from-string-table object shstrtab-section section-names)
    425434    (elf-init-symbol-section-from-symbol-table object symbols-section symbols)
     435    (elf-make-empty-data-for-section object prelink-id-section 0)
    426436    ;; Prepare in-memory data structures.
    427437    (elf-update object #$ELF_C_NULL)
Note: See TracChangeset for help on using the changeset viewer.