This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Assign regions to orphan sections


On Thu, Mar 25, 2010 at 05:55:16PM -0700, Ian Lance Taylor wrote:
> Daniel Jacobowitz <dan@codesourcery.com> writes:
> 
> > I don't think the file header should be loaded in your case, either.
> > Anyone know what determines this?  It's not triggered by use of
> > SIZEOF_HEADERS, I don't think.
> 
> It's done by default if it can be done.  Look at phdr_in_segment in
> _bfd_elf_map_sections_to_segments in bfd/elf.c.

This bit:

      /* Deal with -Ttext or something similar such that the first section
         is not adjacent to the program headers.  This is an
         approximation, since at this point we don't know exactly how many
         program headers we will need.  */
      if (count > 0)
        {
          bfd_size_type phdr_size = elf_tdata (abfd)->program_header_size;

          if (phdr_size == (bfd_size_type) -1)
            phdr_size = get_program_header_size (abfd, info);
          if ((abfd->flags & D_PAGED) == 0
              || sections[0]->lma < phdr_size
              || sections[0]->lma % maxpagesize < phdr_size % maxpagesize)
            phdr_in_segment = FALSE;
        }

It seems to me that if the maximum page size is one byte, then D_PAGED
should be false.  There aren't any pages.  But that's really only the
case for *-elf.  Joseph, would tic6x-uclinux also have MAXPAGESIZE==1?

Anyway, a safe way to fix the test would be to add -z
max-page-size=256.  I think that will do it.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]