2c2
< * Copyright (c) 2010, 2012-2013 ARM Limited
---
> * Copyright (c) 2010, 2012-2013, 2015 ARM Limited
57c57,59
< : System(p), bootldr(NULL), _haveSecurity(p->have_security),
---
> : System(p),
> bootLoaders(), bootldr(nullptr),
> _haveSecurity(p->have_security),
75,76c77,80
< if (p->boot_loader != "") {
< bootldr = createObjectFile(p->boot_loader);
---
> bootLoaders.reserve(p->boot_loader.size());
> for (const auto &bl : p->boot_loader) {
> std::unique_ptr<ObjectFile> obj;
> obj.reset(createObjectFile(bl));
78,79c82,84
< if (!bootldr)
< fatal("Could not read bootloader: %s\n", p->boot_loader);
---
> fatal_if(!obj, "Could not read bootloader: %s\n", bl);
> bootLoaders.emplace_back(std::move(obj));
> }
80a86,97
> if (kernel) {
> bootldr = getBootLoader(kernel);
> } else if (!bootLoaders.empty()) {
> // No kernel specified, default to the first boot loader
> bootldr = bootLoaders[0].get();
> }
>
> if (!bootLoaders.empty() && !bootldr)
> fatal("Can't find a matching boot loader / kernel combination!");
>
> if (bootldr) {
> bootldr->loadGlobalSymbols(debugSymbolTable);
90,92d106
<
< bootldr->loadGlobalSymbols(debugSymbolTable);
<
93a108
>
170a186,196
> ObjectFile *
> ArmSystem::getBootLoader(ObjectFile *const obj)
> {
> for (auto &bl : bootLoaders) {
> if (bl->getArch() == obj->getArch())
> return bl.get();
> }
>
> return nullptr;
> }
>