diff options
author | Eric Christopher <echristo@gmail.com> | 2005-02-22 23:54:41 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2005-02-22 23:54:41 +0000 |
commit | 9b2f1d3522d61a29042aff3f0bebb25b1dfb8f05 (patch) | |
tree | 64273720f8a3d5720aab535137585216d97b5217 | |
parent | 1375e99fd58bf2356b2bcd321c52fe58102afff9 (diff) | |
download | binutils-9b2f1d3522d61a29042aff3f0bebb25b1dfb8f05.zip binutils-9b2f1d3522d61a29042aff3f0bebb25b1dfb8f05.tar.gz binutils-9b2f1d3522d61a29042aff3f0bebb25b1dfb8f05.tar.bz2 |
2005-02-22 Eric Christopher <echristo@redhat.com>
* ld-mips-elf/reloc-merge-lo16.d: Correct symbol
table size for __start.
2005-02-22 Eric Christopher <echristo@redhat.com>
* config/tc-mips.c (struct proc): Change isym to
func_sym. New member func_end_sym.
(s_mips_ent): Update.
(s_mips_end): Ditto. Add code to compute function size.
-rw-r--r-- | gas/ChangeLog | 7 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 22 | ||||
-rw-r--r-- | ld/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-mips-elf/reloc-merge-lo16.d | 2 |
4 files changed, 32 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index bd343d2..6efebf6 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2005-02-22 Eric Christopher <echristo@redhat.com> + + * config/tc-mips.c (struct proc): Change isym to + func_sym. New member func_end_sym. + (s_mips_ent): Update. + (s_mips_end): Ditto. Add code to compute function size. + 2005-02-22 Alan Modra <amodra@bigpond.net.au> * read.c: Warning fixes. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 58536ad..ffc44cb 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -13410,7 +13410,8 @@ mips_elf_final_processing (void) #endif /* OBJ_ELF || OBJ_MAYBE_ELF */ typedef struct proc { - symbolS *isym; + symbolS *func_sym; + symbolS *func_end_sym; unsigned long reg_mask; unsigned long reg_offset; unsigned long fpreg_mask; @@ -13594,7 +13595,7 @@ s_mips_end (int x ATTRIBUTE_UNUSED) if (p != NULL) { assert (S_GET_NAME (p)); - if (strcmp (S_GET_NAME (p), S_GET_NAME (cur_proc_ptr->isym))) + if (strcmp (S_GET_NAME (p), S_GET_NAME (cur_proc_ptr->func_sym))) as_warn (_(".end symbol does not match .ent symbol.")); if (debug_type == DEBUG_STABS) @@ -13604,6 +13605,21 @@ s_mips_end (int x ATTRIBUTE_UNUSED) else as_warn (_(".end directive missing or unknown symbol")); + /* Create an expression to calculate the size of the function. */ + if (p && cur_proc_ptr) + { + OBJ_SYMFIELD_TYPE *obj = symbol_get_obj (p); + expressionS *exp = xmalloc (sizeof (expressionS)); + + obj->size = exp; + exp->X_op = O_subtract; + exp->X_add_symbol = symbol_temp_new_now (); + exp->X_op_symbol = p; + exp->X_add_number = 0; + + cur_proc_ptr->func_end_sym = exp->X_add_symbol; + } + #ifdef OBJ_ELF /* Generate a .pdr section. */ if (OUTPUT_FLAVOR == bfd_target_elf_flavour && ! ECOFF_DEBUGGING @@ -13677,7 +13693,7 @@ s_mips_ent (int aent) cur_proc_ptr = &cur_proc; memset (cur_proc_ptr, '\0', sizeof (procS)); - cur_proc_ptr->isym = symbolP; + cur_proc_ptr->func_sym = symbolP; symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION; diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index bebbb15..9244d48 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-02-22 Eric Christopher <echristo@redhat.com> + + * ld-mips-elf/reloc-merge-lo16.d: Correct symbol + table size for __start. + 2005-02-22 Daniel Jacobowitz <dan@codesourcery.com> * ld-elfvsb/hidden2.d: Expect OBJECT. diff --git a/ld/testsuite/ld-mips-elf/reloc-merge-lo16.d b/ld/testsuite/ld-mips-elf/reloc-merge-lo16.d index f6e7ef8..7cb3cfe 100644 --- a/ld/testsuite/ld-mips-elf/reloc-merge-lo16.d +++ b/ld/testsuite/ld-mips-elf/reloc-merge-lo16.d @@ -8,7 +8,7 @@ .*: +file format .*mips.* #... 0+80fe70 l .rodata 0+000000 g -0+400000 g F .text 0+000000 __start +0+400000 g F .text 0+00000c __start #... 0+400000 <[^>]*> 3c020081 lui v0,0x81 0+400004 <[^>]*> 2443fe70 addiu v1,v0,-400 |