Subject: Re: CVS commit: src/sys/lib/libsa
To: Christos Zoulas <christos@astron.com>
From: Cherry G. Mathew <cherry.g.mathew@gmail.com>
List: source-changes
Date: 04/03/2006 20:55:30
On 4/3/06, Christos Zoulas <christos@astron.com> wrote:

> Why didn't you encapsulate the test for (phdr[i].p_type & PT_LOPROC)
> in MD_LOADSEG(phdr[i]) as I suggested? PT_LOPROC throup PT_HIPROC are
> reserved for processor-specific extensions. Thus another architecture
> might choose not to set PT_LOPROC, but set PT_LOPROC + 1 to indicate
> that it wants to load a segment. Clearly the test does not belong in
> MI code, since the test has processor-specific semantics.
>
> christos
>
>

Sorry about this. I didn't follow your comment properly. Is the
following ok to commit ? It works on ia64 with:

#define MD_LOADSEG(phdr) (phdr.p_type =3D=3D PT_IA_64_UNWIND ?
ia64_unwindtab =3D phdr.p_vaddr, ia64_unwindtablen =3D phdr.p_filesz, 1 :
0)

------------------------------------------------------------------------
+#ifndef MD_LOADSEG /* Allow processor ABI specific segment loads */
+#define MD_LOADSEG(a) /*CONSTCOND*/0
+#endif
+               if (MD_LOADSEG(phdr[i]))
+                       goto loadseg;
+
+
                if (phdr[i].p_type !=3D PT_LOAD ||
                    (phdr[i].p_flags & (PF_W|PF_X)) =3D=3D 0)
                        continue;
@@ -309,6 +317,7 @@
                if ((IS_TEXT(phdr[i]) && (flags & LOAD_TEXT)) ||
                    (IS_DATA(phdr[i]) && (flags & LOAD_DATA))) {

+               loadseg:
                        /* Read in segment. */
                        PROGRESS(("%s%lu", first ? "" : "+",
                            (u_long)phdr[i].p_filesz));
-----------------------------------------------------------------------



--
~Cherry