~ubuntu-branches/debian/squeeze/binutils/squeeze

« back to all changes in this revision

Viewing changes to gold/options.cc

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-09-10 17:05:30 UTC
  • mfrom: (1.4.5 upstream) (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090910170530-wa6gpju9pq5c56on
Tags: 2.19.91.20090910-1
* Snapshot, taken from the 2.20 release branch 20090910, corresponding
  to the 2.19.90 upstream snapshot.
* Fix Thumb-2 shared libraries (Daniel Jacobowitz), patch taken
  from the trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
namespace options
48
48
{
49
49
 
 
50
// This flag is TRUE if we should register the command-line options as they
 
51
// are constructed.  It is set after contruction of the options within
 
52
// class Position_dependent_options.
 
53
static bool ready_to_register = false;
 
54
 
50
55
// This global variable is set up as General_options is constructed.
51
56
static std::vector<const One_option*> registered_options;
52
57
 
60
65
void
61
66
One_option::register_option()
62
67
{
 
68
  if (!ready_to_register)
 
69
    return;
 
70
 
63
71
  registered_options.push_back(this);
64
72
 
65
73
  // We can't make long_options a static Option_map because we can't
75
83
  const int shortname_as_int = static_cast<int>(this->shortname);
76
84
  gold_assert(shortname_as_int >= 0 && shortname_as_int < 128);
77
85
  if (this->shortname != '\0')
78
 
    short_options[shortname_as_int] = this;
 
86
    {
 
87
      gold_assert(short_options[shortname_as_int] == NULL);
 
88
      short_options[shortname_as_int] = this;
 
89
    }
79
90
}
80
91
 
81
92
void
714
725
    do_demangle_(false), plugins_(),
715
726
    incremental_disposition_(INCREMENTAL_CHECK), implicit_incremental_(false)
716
727
{
 
728
  // Turn off option registration once construction is complete.
 
729
  gold::options::ready_to_register = false;
717
730
}
718
731
 
719
732
General_options::Object_format
1039
1052
{
1040
1053
}
1041
1054
 
 
1055
// Pre_options is the hook that sets the ready_to_register flag.
 
1056
 
 
1057
Command_line::Pre_options::Pre_options()
 
1058
{
 
1059
  gold::options::ready_to_register = true;
 
1060
}
 
1061
 
1042
1062
// Process the command line options.  For process_one_option, i is the
1043
1063
// index of argv to process next, and must be an option (that is,
1044
1064
// start with a dash).  The return value is the index of the next