On 02/21/2014 04:17 PM, Ilya Verbin wrote:
2014-02-20 22:27 GMT+04:00 Bernd Schmidt <ber...@codesourcery.com>:
There were still a number of things in these patches that did not make sense
to me and which I've changed. Let me know if there was a good reason for the
way some of these things were originally done.
  * Functions and variables now go into different tables, otherwise
    intermixing between them could be a problem that causes tables to
    go out of sync between host and target (imagine one big table being
    generated by ptx lto1/mkoffload, and multiple small table fragments
    being linked together on the host side).

What do you mean by multiple small table fragments?

Well, suppose you have file1.o and file2.o compiled for the host with a .offload_func_table_section in each, and they get linked together - each provides a fragment of the whole table.

The tables from every object file should be joined together while
linking DSO in the same order for both host and target.
If you need to join tables from multiple target images into one big
table, the host tables also should be joined in the same order.

The problem is that ptx does not have a linker, so we cannot exactly reproduce what happens on the host side. We have to process all host .o files in one single invocation of ptx lto1, and produce a single ptx assembly file, with a single function/variable table, from there. Having functions and variables separated gives us at least a small chance that the order will match that found in the host tables if the host table is produced by linking multiple fragments.

Suppose there is liba, that depends on libb, that depends on libc.

What kind of dependencies between liba and libb do you expect to be able to support on the target side? References to each other's functions and variables?


Bernd

Reply via email to