i386 QNX6 submission

Nick Clifton nickc@cambridge.redhat.com
Thu Mar 21 03:48:00 GMT 2002


Hi Graeme,

  OK I have had another look at these patches and I have a few
  comments:

  * It would be helpful if you provide us with an updated set of
    patches against the 2.12 sources, or even better, the current CVS
    sources.  When you do create these patches please pass "-c3p"
    to diff in order to create a context diff.  This makes it much
    easier to examine and apply the patches.  If you add -N to the
    diff command line you can then also produces "patches" for new
    files too.

  * The patch against config.sub will have to be submitted to the
    address below as it not officially part of binutils:

	config-patches@gnu.org

  * The changes to assign_file_positions_for_segments() seem wrong to
    me.  You say that:

      "The QNX linker issues a special class of relocations
       called segment relocations (SEGREL). The problem is
       that GNU BFD removes these sections.  For example,
       if you strip the QNX6 kernel (procnto) or objcopy it,
       it is no longer usable, because the linker used in
       building boot images (ldrel) needs segment relocations.

       We need to preserve these sections and segments with
       proper offset and size. 
  
       The function _bfd_elf_copy_private_section_data() calls 
       copy_private_bfd_data() only for ALLOCATED sections.
       copy_private_bfd_data() creates internal structures
       for segments composed of sections (mapping output sections
       to segments) but only for ALLOCATED sections. For these
       reasons I redesigned these functions.  This function
       worked for PT_LOAD and PT_NOTE segments, and for non
       PT_LOAD segments containing at least one allocated
       section.  The PT_SEGREL has no such sections."

    And so you have the code assign file positions for any segment
    type.  My feeling is that this will break (or at least
    inconvenience) loaders which expect to be able to ignore segments
    with a zero file position.  A better solution, I feel, would be to
    have a new backend function which determines which segment types
    get assigned file positions.  By default this function would
    behave just as before and segments of type PT_LOAD or segments of
    type PT_NOTE with allocated sections would be selected.  But
    individual backends would be able to override the function with
    their own definition which could select segment types on any basis
    that they choose.

Cheers
        Nick



More information about the Binutils mailing list