Как экспортировать символы из общей библиотеки

Конечно, повторяющаяся проблема: Преобразование имен строк в нескольких фреймах данных в столбец в фрейме данных

Надеюсь, это поможет:

data <- data.frame(x = 1:nrow(data), Sample_ID = row.names(data), data)

5
задан Seanny123 29 November 2018 в 18:28
поделиться

2 ответа

This is how it works on linux:

1) No, you needn't do anything. You can, however, restrict exporting variables with gcc -fvisibility command line argument and explicitly flag exported entries with the visibility attribute.

2) The executable will have a table of all functions it imports (these are all functions with default visibility). The loader/linker will pick an address to load the libraries to and fill this table just before running, the calls to those functions are indirect calls. (Note that this holds for shared objects as well)

3) Static linking is performed on link-time (which is after you compile). The actual addresses are substituted in the assembly, and they are direct calls.

Note: There is the thing called PIC (position independent code). AFAIK, this deals with references to data/functions in the same shared object, so the linker needn't overwrite half of the code of the library when loading the library, in the way that the code doesn't make any absolute references to its own data. You might try to experiment with it.

12
ответ дан 18 December 2019 в 12:01
поделиться

Знаете ли вы что-нибудь о причине сбоя?

Одна из возможностей, если вы загружаете общую библиотеку динамически (например, через dlopen () ), заключается в том, что вы предполагают, что библиотека загружена нормально, хотя это не так, а затем пытаются выполнять функции с помощью нулевых указателей.

0
ответ дан 18 December 2019 в 12:01
поделиться
Другие вопросы по тегам:

Похожие вопросы: