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]

[MIPS] Why is PT_DYNAMIC marked as PF_W (write)?


It looks like the segment flag bits are hard coded to read write execute no matter where they are located. Why is this not a bug? This is for non-IRIX bits.

Traditionally the .dynamic section/segment resides in the text segment, but wherever it gets located the flags are hardcoded as below:

      if (m != NULL && IRIX_COMPAT (abfd) == ict_none)
    {
      /* For a normal mips executable the permissions for the PT_DYNAMIC
         segment are read, write and execute. We do that here since
         the code in elf.c sets only the read permission. This matters
         sometimes for the dynamic linker.  */
      if (bfd_get_section_by_name (abfd, ".dynamic") != NULL)
        {
          m->p_flags = PF_R | PF_W | PF_X;
          m->p_flags_valid = 1;
        }
    }

Are there special rules for segments that are not PT_LOAD? 

If this is obsolete for Mips, can I fix it to match the PT_LOAD segment it overlays? ;-)  The "This matters sometimes for the dynamic linker" is probably part of the answer, but I haven't found it yet. 

Thanks,

Jack


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