[haiku-bugs] Re: [Haiku] #6271: support for images with a single rwx PT_LOAD program header

  • From: "lucian" <trac@xxxxxxxxxxxx>
  • Date: Tue, 06 Jul 2010 14:34:03 -0000

#6271: support for images with a single rwx PT_LOAD program header
----------------------------+-----------------------------------------------
  Reporter:  lucian         |         Owner:  axeld         
      Type:  bug            |        Status:  new           
  Priority:  normal         |     Milestone:  R1            
 Component:  System/Kernel  |       Version:  R1/Development
Resolution:                 |      Keywords:                
Blocked By:                 |   Has a Patch:  1             
  Platform:  All            |      Blocking:                
----------------------------+-----------------------------------------------

Comment (by lucian):

 Ok, on PPC the data segments may be executable, but are there two
 {{{PT_LOAD}}} program headers: one that is .data (rwx) and .text?

 Initially, for me, the single {{{PT_LOAD}}} program header was loaded in
 {{{.data}}} and nothing in {{{.text}}}.

 The problem appeared when it tried to run {{{elf_parse_dynamic_section}}}
 because of
   image->dynamic_section += image->text_region.delta
 from {{{load_kernel_add_on()}}} in {{{src/system/kernel/elf.cpp}}}.

 If there is only a single rwx {{{.data}}} section and no {{{.text}}}
 section, {{{image->text_region.delta}}} will be {{{0}}} => the dynamic
 section will not begin after the {{{.text}}} but after {{{NULL}}}. This
 will most surely result in a page fault.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/6271#comment:6>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: