Add a symbol's value to the computed frag offset, rather than overwriting it.
[deliverable/binutils-gdb.git] / gdb / partial-stab.h
index b4ba251fb939b5c8ff711f24e7fa38134d41db50..87ab12ac3045eeea28c92f825bb184c109027f06 100644 (file)
@@ -577,9 +577,6 @@ switch (CUR_SYMBOL_TYPE)
       case 'f':
        CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 #ifdef DBXREAD_ONLY
-       /* Keep track of the start of the last function so we
-          can handle end of function symbols.  */
-       last_function_start = CUR_SYMBOL_VALUE;
        /* Kludges for ELF/STABS with Sun ACC */
        last_function_name = namestring;
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
@@ -588,12 +585,16 @@ switch (CUR_SYMBOL_TYPE)
        if (pst && textlow_not_set)
          {
            pst->textlow =
-             find_stab_function_addr (namestring, pst, objfile);
+             find_stab_function_addr (namestring, pst->filename, objfile);
            textlow_not_set = 0;
          }
 #endif
        /* End kludge.  */
 
+       /* Keep track of the start of the last function so we
+          can handle end of function symbols.  */
+       last_function_start = CUR_SYMBOL_VALUE;
+
        /* In reordered executables this function may lie outside
           the bounds created by N_SO symbols.  If that's the case
           use the address of this function as the low bound for
@@ -620,22 +621,27 @@ switch (CUR_SYMBOL_TYPE)
       case 'F':
        CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
 #ifdef DBXREAD_ONLY
-       /* Keep track of the start of the last function so we
-          can handle end of function symbols.  */
-       last_function_start = CUR_SYMBOL_VALUE;
        /* Kludges for ELF/STABS with Sun ACC */
        last_function_name = namestring;
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
        /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
           value for the bottom of the text seg in those cases. */
+       if (CUR_SYMBOL_VALUE == ANOFFSET (objfile->section_offsets, 
+                                         SECT_OFF_TEXT))
+         CUR_SYMBOL_VALUE = 
+           find_stab_function_addr (namestring, pst->filename, objfile);
        if (pst && textlow_not_set)
          {
-           pst->textlow =
-             find_stab_function_addr (namestring, pst, objfile);
+           pst->textlow = CUR_SYMBOL_VALUE;
            textlow_not_set = 0;
          }
 #endif
        /* End kludge.  */
+
+       /* Keep track of the start of the last function so we
+          can handle end of function symbols.  */
+       last_function_start = CUR_SYMBOL_VALUE;
+
        /* In reordered executables this function may lie outside
           the bounds created by N_SO symbols.  If that's the case
           use the address of this function as the low bound for
This page took 0.024036 seconds and 4 git commands to generate.