bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: as/ld silently creates programs with undefined references/symbols


From: Nick Clifton
Subject: Re: as/ld silently creates programs with undefined references/symbols
Date: Mon, 12 Jul 2004 08:55:14 +0100
User-agent: Mozilla Thunderbird 0.7 (X11/20040615)

Hi Russell,

Also, I notice with binutils 2.15, we end up with lots of $a and $d
symbols in the kernel symbol table, eg:

Ah - yes. These are the mapping symbols that are required by the ARM ELF ABI. In theory they should have been generated by the assembler from day 1, but it is only recently that the code was contributed to create them.

I quite understand that they are annoying and I have been wondering if it would be worthwhile adding a command line option to suppress them. So, if you have some time, would you care to try out the attached patch and let me know what you think ?

Cheers
  Nick

gas/ChangeLog
2004-07-12  Nick Clifton  <address@hidden>

        * config/tc-arm.c (suppress_mapping_symbols): New static variable.
        (mapping_state): Do nothing if suppress_mapping_symbols is true.
        (arm_opts): New switch: -msuppress-mapping-symbols.
        * doc/c-arm.texi: Document new switch.



Index: gas/config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.169
diff -c -3 -p -r1.169 tc-arm.c
*** gas/config/tc-arm.c 2 Jul 2004 11:12:29 -0000       1.169
--- gas/config/tc-arm.c 12 Jul 2004 07:42:51 -0000
*************** enum arm_float_abi
*** 171,176 ****
--- 171,179 ----
  
  static unsigned long cpu_variant;
  static int target_oabi = 0;
+ #ifdef OBJ_ELF
+ static int suppress_mapping_symbols = 0;
+ #endif
  
  /* Flags stored in private area of BFD structure.  */
  static int uses_apcs_26      = FALSE;
*************** mapping_state (enum mstate state)
*** 2912,2917 ****
--- 2915,2923 ----
    const char * symname;
    int type;
  
+   if (suppress_mapping_symbols)
+     return;
+ 
    if (mapstate == state)
      /* The mapping symbol has already been emitted.
         There is nothing else to do.  */
*************** struct arm_option_table arm_opts[] =
*** 13183,13188 ****
--- 13189,13198 ----
     1, NULL},
    {"mapcs-reentrant", N_("re-entrant code"), &pic_code, 1, NULL},
    {"matpcs", N_("code is ATPCS conformant"), &atpcs, 1, NULL},
+ #ifdef OBJ_ELF
+   {"msuppress-mapping-symbols", N_("do no generate mapping symbols ($a $d 
$t)"),
+    &suppress_mapping_symbols, 1, NULL},
+ #endif
    {"mbig-endian", N_("assemble for big-endian"), &target_big_endian, 1, NULL},
    {"mlittle-endian", N_("assemble for little-endian"), &target_big_endian, 1,
     NULL},
Index: gas/doc/c-arm.texi
===================================================================
RCS file: /cvs/src/src/gas/doc/c-arm.texi,v
retrieving revision 1.27
diff -c -3 -p -r1.27 c-arm.texi
*** gas/doc/c-arm.texi  23 Mar 2004 23:05:52 -0000      1.27
--- gas/doc/c-arm.texi  12 Jul 2004 07:42:52 -0000
*************** The following values are recognised:
*** 237,242 ****
--- 237,252 ----
  and
  @code{3}.
  
+ @cindex @code{-msuppress-mapping-symbols} command line option, ARM
+ @item -msuppress-mapping-symbols
+ This option disables the generation of the mapping symbols $a, $d and
+ $t which the assembler will normally insert into an ELF format object
+ file.  These symbols are required by the ARM ELF ABI and they indicate
+ transitions betweem ARM and THUMB instructions and between
+ instructions and data.  For some environments however the presence of
+ these symbols can be frustrating, so this option is provided to remove
+ them.
+ 
  @cindex @code{-EB} command line option, ARM
  @item -EB
  This option specifies that the output generated by the assembler should

reply via email to

[Prev in Thread] Current Thread [Next in Thread]