[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/6] refactor linker to lay out ELF files and memory in the s
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH 4/6] refactor linker to lay out ELF files and memory in the same way |
Date: |
Wed, 22 May 2013 22:56:19 +0200 |
User-agent: |
Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) |
This goes beyond my ELF capabilities, so can’t really comment on this.
Style comments:
Andy Wingo <address@hidden> skribis:
> * module/system/vm/linker.scm (make-linker-object):
> (linker-object-section-symbol):
> (linker-object-symbols*): Create a symbol to the start of a linker
> object. Hide it from the external linker-object-symbols* accessor.
>
> (segment-kind, count-segments): Sections without SHF_ALLOC don't get
> segments.
> (collate-objects-into-segments): Allow for #f segment types. If two
> sections have the same type and flags, leave them in the same order.
>
> (align): Allow for 0 alignment.
>
> (add-elf-objects): New helper: puts the ELF data structures (header,
> segment table, and section table) in sections of their own. This
> lends a nice clarity and conceptual unity to the linker.
Please move the descriptions as docstrings.
> (relocate-section-header, alloc-objects): Lay out segments with
> congruent, contiguous addresses, so that we can just mmap the file and
> if debugging sections that are not in segments are present, they can
> be lazily paged in if needed by the kernel's VM system.
Nice. Could you move this comment in the code?
> ;; objects ::= list of <linker-object>
> -;; => 3 values: ELF header, program headers, objects
> +;;
> +;; => 3 values:
> +;; file size
> +;; objects with allocated memory address and file offset
> +;; symbol table
> +;;
> (define (allocate-elf objects page-aligned? endianness word-size)
What does it do?
Ludo’.
- Re: [PATCH 6/6] add (find-mapped-elf-image) procedure to (system vm objcode) module, (continued)
[PATCH 3/6] elf: add accessors for header members that might need relocation, Andy Wingo, 2013/05/18
[PATCH 4/6] refactor linker to lay out ELF files and memory in the same way, Andy Wingo, 2013/05/18
- Re: [PATCH 4/6] refactor linker to lay out ELF files and memory in the same way,
Ludovic Courtès <=
[PATCH 1/6] split linker out of elf module, Andy Wingo, 2013/05/18
Re: wip-linker: Refactor ELF linker and loader, Ludovic Courtès, 2013/05/22