@Override public Iterable<BuildDependency> getDependencies(Map<Element, LayoutDecisionMap> decisions) { return defaultDependencies(decisions, this); }
@Override public Iterable<BuildDependency> getDependencies(Map<Element, LayoutDecisionMap> decisions) { return ObjectFile.defaultDependencies(decisions, element); }
@Override public Iterable<BuildDependency> getDependencies(Map<Element, LayoutDecisionMap> decisions) { return ObjectFile.defaultDependencies(decisions, this); }
@Override public Iterable<BuildDependency> getDependencies(Map<Element, LayoutDecisionMap> decisions) { ArrayList<BuildDependency> ourDeps = new ArrayList<>(ObjectFile.defaultDependencies(decisions, this)); return ourDeps; }
@Override public Iterable<BuildDependency> getDependencies(Map<Element, LayoutDecisionMap> decisions) { return ObjectFile.defaultDependencies(decisions, getElement()); }
@Override public Iterable<BuildDependency> getDependencies(Map<Element, LayoutDecisionMap> decisions) { ArrayList<BuildDependency> ourDeps = new ArrayList<>(ObjectFile.defaultDependencies(decisions, this)); // we depend on the contents of our strtab ourDeps.add(BuildDependency.createOrGet(decisions.get(this).getDecision(LayoutDecision.Kind.CONTENT), decisions.get(strtab).getDecision(LayoutDecision.Kind.CONTENT))); // if we're dynamic, we also depend on vaddrs of any sections into which our symbols refer if (isDynamic()) { Set<ELFSection> referencedSections = new HashSet<>(); for (Entry ent : entries) { ELFSection es = ent.getReferencedSection(); if (es != null) { referencedSections.add(es); } } for (ELFSection es : referencedSections) { ourDeps.add(BuildDependency.createOrGet(decisions.get(this).getDecision(LayoutDecision.Kind.CONTENT), decisions.get(es).getDecision(LayoutDecision.Kind.VADDR))); } } return ourDeps; }
@Override public Iterable<BuildDependency> getDependencies(Map<Element, LayoutDecisionMap> decisions) { // our content depends on the offset of every section we're going to reference HashSet<BuildDependency> deps = ObjectFile.defaultDependencies(decisions, this); ArrayList<Section> requiredOffsets = new ArrayList<>(); for (LoadCommand c : loadCommands) { if (c instanceof SymtabCommand) { SymtabCommand syms = (SymtabCommand) c; for (Symbol sym : syms.symtab) { if (sym.isDefined() && sym.isFunction() && !sym.isAbsolute()) { Section s = sym.getDefinedSection(); assert s != null; requiredOffsets.add(s); } } } } LayoutDecision ourContent = decisions.get(this).getDecision(LayoutDecision.Kind.CONTENT); for (Section s : requiredOffsets) { deps.add(BuildDependency.createOrGet(ourContent, decisions.get(s).getDecision(LayoutDecision.Kind.OFFSET))); } return deps; }
@Override public Iterable<BuildDependency> getDependencies(Map<Element, LayoutDecisionMap> decisions) { /* * Our contents depend on * * - the content, size and offset of shstrtab (Q. Why content? A. Because we write * string *indices*.) * * - the size and offset of every other element in the file. (Q. Why size? A. Because * the SHT entry includes the size.) * * - the vaddrs of every allocated section */ HashSet<BuildDependency> deps = ObjectFile.defaultDependencies(decisions, this); LayoutDecision ourContent = decisions.get(this).getDecision(LayoutDecision.Kind.CONTENT); // to construct a dependency, first we must have constructed the decisions deps.add(BuildDependency.createOrGet(ourContent, decisions.get(shstrtab).getDecision(LayoutDecision.Kind.SIZE))); deps.add(BuildDependency.createOrGet(ourContent, decisions.get(shstrtab).getDecision(LayoutDecision.Kind.OFFSET))); deps.add(BuildDependency.createOrGet(ourContent, decisions.get(shstrtab).getDecision(LayoutDecision.Kind.CONTENT))); decisions.get(shstrtab).getDecision(LayoutDecision.Kind.OFFSET); decisions.get(shstrtab).getDecision(LayoutDecision.Kind.CONTENT); for (Element e : getElements()) { if (e != this && e != shstrtab) { deps.add(BuildDependency.createOrGet(ourContent, decisions.get(e).getDecision(LayoutDecision.Kind.OFFSET))); deps.add(BuildDependency.createOrGet(ourContent, decisions.get(e).getDecision(LayoutDecision.Kind.SIZE))); } } return deps; }
HashSet<BuildDependency> deps = ObjectFile.defaultDependencies(decisions, this);