Changeset 13181 for release/1.4


Ignore:
Timestamp:
Nov 9, 2009, 10:03:38 AM (10 years ago)
Author:
gb
Message:

(in 1.4) In FIXUP-LISP-SECTION-HEADER-OFFSET, set the section header's
type to #$SHT_PROGBITS (fixes ticket:625).

While we're there, add an extra page to the calculated offset,
to account for the preceding image and section headers on 32-bit
platforms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/1.4/source/library/elf.lisp

    r13075 r13181  
    313313      (fd-read fd shdr (record-length #+64-bit-target :<E>lf64_<S>hdr
    314314                                      #+32-bit-target :<E>lf32_<S>hdr))
     315      ;; On 64-bit platforms, the section data precedes the image
     316      ;; header; on 32-bit platforms, the image header and image
     317      ;; section table precede the image data for the first (static)
     318      ;; section.  With alignment, the header/section headers are
     319      ;; one 4K page, and the static section size is 8K ...
    315320      (setf (pref shdr #+64-bit-target :<E>lf64_<S>hdr.sh_offset
    316321                  #+32-bit-target :<E>lf32_<S>hdr.sh_offset)
    317             (+ #x2000 (logandc2 (+ eof 4095) 4095))) ; #x2000 for nilreg-area
     322            (+ #+32-bit-target #x1000 #+64-bit-target 0  #x2000 (logandc2 (+ eof 4095) 4095)))
     323      (setf (pref shdr #+64-bit-target :<E>lf64_<S>hdr.sh_type
     324                  #+32-bit-target :<E>lf32_<S>hdr.sh_type)
     325            #$SHT_PROGBITS)
    318326      (fd-lseek fd pos #$SEEK_SET)
    319327      (fd-write fd shdr (record-length #+64-bit-target :<E>lf64_<S>hdr
Note: See TracChangeset for help on using the changeset viewer.