+void Architecture::parse_specification(const string &spec)
+{
+ vector<string> parts = split(spec, "-");
+ resolve_aliases(parts);
+ for(vector<string>::const_iterator i=parts.begin(); i!=parts.end(); ++i)
+ {
+ bool ok = false;
+
+ for(unsigned j=0; (!ok && types[j]); ++j)
+ if(*i==types[j])
+ {
+ if(!type.empty() && *i!=type)
+ throw invalid_argument("Conflicting type specification");
+ type = *i;
+ ok = true;
+ }
+
+ for(unsigned j=0; (!ok && cpus[j]); j+=2)
+ if(*i==cpus[j])
+ {
+ if(type.empty())
+ type = cpus[j+1];
+ else if(cpus[j+1]!=type)
+ throw invalid_argument("Conflicting CPU specification");
+ cpu = *i;
+ ok = true;
+ }
+
+ for(unsigned j=0; (!ok && fpus[j]); j+=2)
+ if(*i==fpus[j])
+ {
+ if(fpus[j+1]!=type)
+ throw invalid_argument("Conflicting FPU specification");
+ fpu = *i;
+ ok = true;
+ }
+
+ for(unsigned j=0; (!ok && systems[j]); ++j)
+ if(*i==systems[j])
+ {
+ system = *i;
+ ok = true;
+ }
+
+ for(unsigned j=0; (!ok && toolchains[j]); ++j)
+ if(*i==toolchains[j])
+ {
+ toolchain = *i;
+ ok = true;
+ }
+
+ if(!ok && (*i=="32" || *i=="64"))
+ {
+ bits = lexical_cast<unsigned>(*i);
+ ok = true;
+ }
+
+ if(!ok)
+ throw invalid_argument("Unrecognized part in arch specification: "+*i);
+ }
+}
+
+
+Architecture::Loader::Loader(Architecture &a):
+ DataFile::ObjectLoader<Architecture>(a)