Print this page
patch lower-case-segops

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/exec/elf/elf.c
          +++ new/usr/src/uts/common/exec/elf/elf.c
↓ open down ↓ 1475 lines elided ↑ open up ↑
1476 1476                  int symtab_ndx = 0;
1477 1477  
1478 1478                  /*
1479 1479                   * Since we're just looking for text segments of load
1480 1480                   * objects, we only care about the protection bits; we don't
1481 1481                   * care about the actual size of the segment so we use the
1482 1482                   * reserved size. If the segment's size is zero, there's
1483 1483                   * something fishy going on so we ignore this segment.
1484 1484                   */
1485 1485                  if (seg->s_ops != &segvn_ops ||
1486      -                    SEGOP_GETVP(seg, seg->s_base, &mvp) != 0 ||
     1486 +                    segop_getvp(seg, seg->s_base, &mvp) != 0 ||
1487 1487                      mvp == lastvp || mvp == NULL || mvp->v_type != VREG ||
1488 1488                      (segsize = pr_getsegsize(seg, 1)) == 0)
1489 1489                          continue;
1490 1490  
1491 1491                  eaddr = saddr + segsize;
1492 1492                  prot = pr_getprot(seg, 1, &tmp, &saddr, &naddr, eaddr);
1493 1493                  pr_getprot_done(&tmp);
1494 1494  
1495 1495                  /*
1496 1496                   * Skip this segment unless the protection bits look like
↓ open down ↓ 410 lines elided ↑ open up ↑
1907 1907                          if (prot & PROT_READ)
1908 1908                                  v[i].p_flags |= PF_R;
1909 1909                          if (prot & PROT_WRITE)
1910 1910                                  v[i].p_flags |= PF_W;
1911 1911                          if (prot & PROT_EXEC)
1912 1912                                  v[i].p_flags |= PF_X;
1913 1913  
1914 1914                          /*
1915 1915                           * Figure out which mappings to include in the core.
1916 1916                           */
1917      -                        type = SEGOP_GETTYPE(seg, saddr);
     1917 +                        type = segop_gettype(seg, saddr);
1918 1918  
1919 1919                          if (saddr == stkbase && size == stksize) {
1920 1920                                  if (!(content & CC_CONTENT_STACK))
1921 1921                                          goto exclude;
1922 1922  
1923 1923                          } else if (saddr == brkbase && size == brksize) {
1924 1924                                  if (!(content & CC_CONTENT_HEAP))
1925 1925                                          goto exclude;
1926 1926  
1927 1927                          } else if (seg->s_ops == &segspt_shmops) {
↓ open down ↓ 6 lines elided ↑ open up ↑
1934 1934                                  }
1935 1935  
1936 1936                          } else if (seg->s_ops != &segvn_ops) {
1937 1937                                  goto exclude;
1938 1938  
1939 1939                          } else if (type & MAP_SHARED) {
1940 1940                                  if (shmgetid(p, saddr) != SHMID_NONE) {
1941 1941                                          if (!(content & CC_CONTENT_SHM))
1942 1942                                                  goto exclude;
1943 1943  
1944      -                                } else if (SEGOP_GETVP(seg, seg->s_base,
     1944 +                                } else if (segop_getvp(seg, seg->s_base,
1945 1945                                      &mvp) != 0 || mvp == NULL ||
1946 1946                                      mvp->v_type != VREG) {
1947 1947                                          if (!(content & CC_CONTENT_SHANON))
1948 1948                                                  goto exclude;
1949 1949  
1950 1950                                  } else {
1951 1951                                          if (!(content & CC_CONTENT_SHFILE))
1952 1952                                                  goto exclude;
1953 1953                                  }
1954 1954  
1955      -                        } else if (SEGOP_GETVP(seg, seg->s_base, &mvp) != 0 ||
     1955 +                        } else if (segop_getvp(seg, seg->s_base, &mvp) != 0 ||
1956 1956                              mvp == NULL || mvp->v_type != VREG) {
1957 1957                                  if (!(content & CC_CONTENT_ANON))
1958 1958                                          goto exclude;
1959 1959  
1960 1960                          } else if (prot == (PROT_READ | PROT_EXEC)) {
1961 1961                                  if (!(content & CC_CONTENT_TEXT))
1962 1962                                          goto exclude;
1963 1963  
1964 1964                          } else if (prot == PROT_READ) {
1965 1965                                  if (!(content & CC_CONTENT_RODATA))
↓ open down ↓ 252 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX