Bug 19370 - .size directive not emitted for mips-linux
Summary: .size directive not emitted for mips-linux
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3.4
: P2 normal
Target Milestone: ---
Assignee: Eric Christopher
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2005-01-11 09:28 UTC by Angela Marie Thomas
Modified: 2005-06-05 07:41 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: mips-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2005-01-11 22:43:26


Attachments
patch to emit .size directive for mips-linux (310 bytes, patch)
2005-01-11 09:29 UTC, Angela Marie Thomas
Details | Diff
testing diff for size problem (1.81 KB, patch)
2005-01-12 23:44 UTC, Eric Christopher
Details | Diff
new patch (1.82 KB, patch)
2005-02-02 23:08 UTC, Eric Christopher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Angela Marie Thomas 2005-01-11 09:28:06 UTC
In config/mips/linux.h, the macro ASM_DECLARE_FUNCTION_SIZE() doesn't actually 
emit the .size directive.  Testcase follows.

% cat tst.c
int
func1(void)
{
  return(1);
}
% mips-linux-gcc -c tst.c                   
% mips-linux-readelf -s tst.o             

Symbol table '.symtab' contains 11 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 FILE    LOCAL  DEFAULT  ABS tst.c
     2: 00000000     0 SECTION LOCAL  DEFAULT    1
     3: 00000000     0 SECTION LOCAL  DEFAULT    3 
     4: 00000000     0 SECTION LOCAL  DEFAULT    4
     5: 00000000     0 SECTION LOCAL  DEFAULT    8 
     6: 00000000     0 SECTION LOCAL  DEFAULT    5
     7: 00000000     0 SECTION LOCAL  DEFAULT    6
     8: 00000000     0 SECTION LOCAL  DEFAULT    9
     9: 00000000     0 FUNC    GLOBAL DEFAULT    1 func1
    10: 00000000     0 OBJECT  GLOBAL DEFAULT  UND _gp_disp

Will attach a patch after bug is opened.
Comment 1 Angela Marie Thomas 2005-01-11 09:29:35 UTC
Created attachment 7927 [details]
patch to emit .size directive for mips-linux
Comment 2 Angela Marie Thomas 2005-01-11 09:32:03 UTC
Forgot to note.  I found it in 3.3.4 but it looks like it's still a problem in 
mainline.
Comment 3 Eric Christopher 2005-01-12 23:44:08 UTC
Created attachment 7942 [details]
testing diff for size problem

here's a testing patch for it. as we spoke this is a problem in binutils, not
gcc. the patch also adds unwind info if it doesn't exist.
Comment 4 Eric Christopher 2005-02-02 23:08:44 UTC
Created attachment 8129 [details]
new patch

Here's another patch that I'm testing. I was doing this in a weird place
before. It implements the size directive and adds the .eh_frame section if not
there. If you've still got the large binary problems let me know and I'll give
you a patch for just the size directives. On the bright side readelf -s does
give what appear to be accurate sizes for the functions now.
Comment 5 Eric Christopher 2005-04-05 21:05:53 UTC
fixed quite a while ago.
Comment 6 Andrew Pinski 2005-06-05 07:40:55 UTC
Reopening to ...
Comment 7 Andrew Pinski 2005-06-05 07:41:28 UTC
Fixed (I thought we have a state called MOVED).