United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6847305 solaris reorder mapfiles generate too many warnings
JDK-6847305 : solaris reorder mapfiles generate too many warnings

Details
Type:
Bug
Submit Date:
2009-06-02
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2009-06-17
Component:
hotspot
OS:
solaris_9
Sub-Component:
compiler
CPU:
sparc
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs16
Fixed Versions:
hs16 (b04)

Related Reports
Backport:
Backport:

Sub Tasks

Description
The reorder mapfiles mention many symbols that don't exist anymore.  Previous attempts to generate new ones didn't help and removing the existing ones hurt, so for now we should remove all the ones it complains about so we don't have to see them every time.

                                    

Comments
EVALUATION

remove all lines that generate warnings
                                     
2009-06-02
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/435f0808b826
                                     
2009-06-04
EVALUATION

Here's the shell script and awk script I used to remove the warnings.  Basically it runs the compile, pulls the name of the reorder file from the log and passes the reorder file and log file to the script.  The script then compares the reorder file and the warning and removes all lines that produced warnings.  The output is copied back onto the old reorder file and the mapfile is regenerated and libjvm.so is relinked so you can get for warnings.

--- warn ---

ws=/net/smite/export/ws/reorder/
mfiles=$ws/make/solaris/makefiles
work=work

build() {
  set -x
  d=$1
  shift
  rm -fr $work/$d
  (cd $work; gnumake -f $ws/make/solaris/Makefile $*) > $d.log 2>&1
  reorder=`grep "cat mapfile" $d.log | awk '{ print $4; }'`
  nawk -f reorder.awk $d.log $reorder > r.txt
  cp r.txt $reorder
  rm -fr $work/$d/product/libjvm.so
  grep "cat mapfile" $d.log | (cd $work/$d/product; sh)
  (cd $work; gnumake -f $ws/make/solaris/Makefile $*)
}

build solaris_i486_compiler2  product
build solaris_amd64_compiler2 product LP64=1
build solaris_i486_compiler1  product1
build solaris_sparc_compiler2  product
build solaris_sparcv9_compiler2 product LP64=1
build solaris_sparc_compiler1  product1

--- reorder.awk ---

BEGIN {
  system("rm warnings.txt");
}
/ld: warning: mapfile: text segment: section/ {
  warnings[$0] = $0;
  warncount++;
}
/^data = R/ {
  while (!($0 ~ "^text:")) {
    prefix[prefixlines++] = $0;
    getline;
  }
}
/^text:/ {
  lines[linecount++] = $0;
  gsub("[%:; \t]", " ");
  n = split($0, f);
  if (n == 3) {
    printf "ld: warning: mapfile: text segment: section `.text%%%s' does not appear in any input file\n", f[3] > "warnings.txt";
  } else if (n == 4) {
    printf "ld: warning: mapfile: text segment: section `.text%%%s' does not appear in file `%s'\n", f[3], f[4] > "warnings.txt";
  } else {
    print "what?";
    print $0;
    print n;
    print f[1];
    print f[2];
    print f[3];
    print f[4];
    print f[5];
    exit(1);
  }
  next;
}
END {
  for (i = 0; i < prefixlines; i++) {
    print prefix[i];
  }
  system("c++filt warnings.txt > warnings.processed.txt");
  inline = 0;
  while ((getline < "warnings.processed.txt") == 1) {
    orig = lines[inline];
    warning = $0;
    if (warning in warnings) {
      delete warnings[warning];
      warncount--;
    } else {
      print orig;
    }
    inline++;
  }
}
                                     
2009-06-04



Hardware and Software, Engineered to Work Together