forked from Imagelibrary/binutils-gdb
2009-12-02 Rafael Avila de Espindola <espindola@google.com>
* incremental-dump.cc (main): Check that the offeset of a script is 0. * incremental.cc (Incremental_inputs::sized_create_inputs_section_data): Write 0 for the data_offset of scripts.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2009-12-02 Rafael Avila de Espindola <espindola@google.com>
|
||||||
|
|
||||||
|
* incremental-dump.cc (main): Check that the offeset of a script is 0.
|
||||||
|
* incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
|
||||||
|
Write 0 for the data_offset of scripts.
|
||||||
|
|
||||||
2009-12-02 Rafael Avila de Espindola <espindola@google.com>
|
2009-12-02 Rafael Avila de Espindola <espindola@google.com>
|
||||||
|
|
||||||
* testsuite/Makefile.am: Add the incremental_test.sh test.
|
* testsuite/Makefile.am: Add the incremental_test.sh test.
|
||||||
|
|||||||
@@ -166,6 +166,12 @@ main(int argc, char** argv)
|
|||||||
break;
|
break;
|
||||||
case INCREMENTAL_INPUT_SCRIPT:
|
case INCREMENTAL_INPUT_SCRIPT:
|
||||||
printf("Linker script\n");
|
printf("Linker script\n");
|
||||||
|
if (input->data_offset != 0)
|
||||||
|
{
|
||||||
|
fprintf(stderr,"%s: %s: %u is a script but offset is not zero",
|
||||||
|
argv[0], filename, i);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case INCREMENTAL_INPUT_INVALID:
|
case INCREMENTAL_INPUT_INVALID:
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -650,6 +650,22 @@ Incremental_inputs::sized_create_inputs_section_data()
|
|||||||
int filename_offset =
|
int filename_offset =
|
||||||
this->strtab_->get_offset_from_key(it->second.filename_key);
|
this->strtab_->get_offset_from_key(it->second.filename_key);
|
||||||
entry.put_filename_offset(filename_offset);
|
entry.put_filename_offset(filename_offset);
|
||||||
|
switch (it->second.type)
|
||||||
|
{
|
||||||
|
case INCREMENTAL_INPUT_SCRIPT:
|
||||||
|
entry.put_data_offset(0);
|
||||||
|
break;
|
||||||
|
case INCREMENTAL_INPUT_ARCHIVE:
|
||||||
|
case INCREMENTAL_INPUT_OBJECT:
|
||||||
|
case INCREMENTAL_INPUT_SHARED_LIBRARY:
|
||||||
|
// TODO: add per input data. Currently we store
|
||||||
|
// an out-of-bounds offset for future version of gold to reject
|
||||||
|
// such an incremental_inputs section.
|
||||||
|
entry.put_data_offset(0xffffffff);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
gold_unreachable();
|
||||||
|
}
|
||||||
// TODO: add per input data and timestamp. Currently we store
|
// TODO: add per input data and timestamp. Currently we store
|
||||||
// an out-of-bounds offset for future version of gold to reject
|
// an out-of-bounds offset for future version of gold to reject
|
||||||
// such an incremental_inputs section.
|
// such an incremental_inputs section.
|
||||||
|
|||||||
Reference in New Issue
Block a user