diff --git a/main.cc b/main.cc index 72c87640..977dc200 100644 --- a/main.cc +++ b/main.cc @@ -753,9 +753,9 @@ int main(int argc, char **argv) { out::chunks.push_back(out::shdr); // Set section indices. - for (int i = 0; i < out::chunks.size(); i++) + for (int i = 0, shndx = 1; i < out::chunks.size(); i++) if (out::chunks[i]->kind != OutputChunk::HEADER) - out::chunks[i]->shndx = i + 1; + out::chunks[i]->shndx = shndx++; // Now that we have computed sizes for all sections and assigned // section indices to them, so we can fix section header contents diff --git a/options.td b/options.td index 9126f366..c789a559 100644 --- a/options.td +++ b/options.td @@ -25,3 +25,6 @@ defm trace_symbol: Eq<"trace-symbol", "Trace references to symbol">; def trace: F<"trace">, HelpText<"Print the name of each input file">; def filler: Separate<["--", "-"], "filler">; + +def: F<"as-needed">; +def: F<"no-as-needed">; \ No newline at end of file