filter.set_public_symbols();
std::string dict_name;
- if (corp->get_origin() & corpus::LINUX_KERNEL_BINARY_ORIGIN)
+ if ((corp->get_origin() & corpus::LINUX_KERNEL_BINARY_ORIGIN)
+ && ctxt->cur_corpus_group_)
{
tools_utils::base_name(ctxt->filename, dict_name);
ABG_ASSERT(ctxt->symtab);
corp->set_symtab(ctxt->symtab);
- if (corp->get_origin() & corpus::LINUX_KERNEL_BINARY_ORIGIN)
+ if ((corp->get_origin() & corpus::LINUX_KERNEL_BINARY_ORIGIN)
+ && ctxt->cur_corpus_group_)
{
status |= elf_reader::STATUS_OK;
return;
(ctxt->cur_corpus_->get_exported_decls_builder().get());
int errp;
- if (corp->get_origin() & corpus::LINUX_KERNEL_BINARY_ORIGIN)
+ if ((corp->get_origin() & corpus::LINUX_KERNEL_BINARY_ORIGIN)
+ && ctxt->cur_corpus_group_)
{
if (ctxt->ctfa == NULL)
{
--- /dev/null
+<abi-corpus version='2.1' path='data/test-read-ctf/test-linux-module.ko'>
+ <elf-function-symbols>
+ <elf-symbol name='testexport' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes' crc='0x533ba8e8'/>
+ <elf-symbol name='testexport2' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes' crc='0x65900b2f'/>
+ </elf-function-symbols>
+ <elf-variable-symbols>
+ <elf-symbol name='global_sym' size='4' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes' crc='0x44a6713b'/>
+ </elf-variable-symbols>
+ <abi-instr address-size='64' language='LANG_C'>
+ <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-1'/>
+ <class-decl name='__raw_tickets' size-in-bits='32' alignment-in-bits='16' is-struct='yes' visibility='default' id='type-id-2'>
+ <data-member access='public' layout-offset-in-bits='0'>
+ <var-decl name='owner' type-id='type-id-3' visibility='default'/>
+ </data-member>
+ <data-member access='public' layout-offset-in-bits='16'>
+ <var-decl name='next' type-id='type-id-3' visibility='default'/>
+ </data-member>
+ </class-decl>
+ <class-decl name='arch_spinlock_t' size-in-bits='32' alignment-in-bits='32' is-struct='yes' naming-typedef-id='type-id-4' visibility='default' id='type-id-5'>
+ <data-member access='public' layout-offset-in-bits='0'>
+ <var-decl name='' type-id='type-id-6' visibility='default'/>
+ </data-member>
+ </class-decl>
+ <class-decl name='raw_spinlock' size-in-bits='32' alignment-in-bits='32' is-struct='yes' visibility='default' id='type-id-7'>
+ <data-member access='public' layout-offset-in-bits='0'>
+ <var-decl name='raw_lock' type-id='type-id-4' visibility='default'/>
+ </data-member>
+ </class-decl>
+ <class-decl name='spinlock' size-in-bits='32' alignment-in-bits='32' is-struct='yes' visibility='default' id='type-id-8'>
+ <data-member access='public' layout-offset-in-bits='0'>
+ <var-decl name='' type-id='type-id-9' visibility='default'/>
+ </data-member>
+ </class-decl>
+ <union-decl name='' size-in-bits='32' is-anonymous='yes' visibility='default' id='type-id-9'>
+ <data-member access='public'>
+ <var-decl name='rlock' type-id='type-id-7' visibility='default'/>
+ </data-member>
+ </union-decl>
+ <union-decl name='' size-in-bits='32' is-anonymous='yes' visibility='default' id='type-id-6'>
+ <data-member access='public'>
+ <var-decl name='slock' type-id='type-id-10' visibility='default'/>
+ </data-member>
+ <data-member access='public'>
+ <var-decl name='tickets' type-id='type-id-2' visibility='default'/>
+ </data-member>
+ </union-decl>
+ <type-decl name='unsigned int' size-in-bits='32' alignment-in-bits='32' id='type-id-11'/>
+ <type-decl name='unsigned short int' size-in-bits='16' alignment-in-bits='16' id='type-id-12'/>
+ <pointer-type-def type-id='type-id-13' size-in-bits='64' alignment-in-bits='64' id='type-id-14'/>
+ <function-decl name='testexport' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='8' elf-symbol-id='testexport'>
+ <return type-id='type-id-1'/>
+ </function-decl>
+ <function-decl name='testexport2' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='8' elf-symbol-id='testexport2'>
+ <parameter type-id='type-id-14'/>
+ <return type-id='type-id-1'/>
+ </function-decl>
+ <var-decl name='global_sym' type-id='type-id-1' mangled-name='global_sym' visibility='default' elf-symbol-id='global_sym'/>
+ <typedef-decl name='__u16' type-id='type-id-12' id='type-id-15'/>
+ <typedef-decl name='__u32' type-id='type-id-11' id='type-id-16'/>
+ <typedef-decl name='arch_spinlock_t' type-id='type-id-5' id='type-id-4'/>
+ <typedef-decl name='spinlock_t' type-id='type-id-8' id='type-id-13'/>
+ <typedef-decl name='u16' type-id='type-id-15' id='type-id-3'/>
+ <typedef-decl name='u32' type-id='type-id-16' id='type-id-10'/>
+ </abi-instr>
+</abi-corpus>
--- /dev/null
+#include <linux/kernel.h>
+#include <linux/module.h>
+
+int global_sym = 0;
+EXPORT_SYMBOL(global_sym);
+static spinlock_t my_lock;
+
+int testexport(void)
+{
+ printk("in testexport\n");
+ return 0;
+}
+
+EXPORT_SYMBOL(testexport);
+
+int testexport2(spinlock_t *t)
+{
+ printk("in testexport\n");
+ return 0;
+}
+EXPORT_SYMBOL(testexport2);
+
+int hello_init(void)
+{
+ printk(KERN_INFO "Hello World!\n");
+ return 0;
+}
+
+void hello_exit(void)
+{
+ printk(KERN_INFO "Bye World!\n");
+}
+
+module_init(hello_init);
+module_exit(hello_exit);
+
+MODULE_LICENSE("GPL");
"data/test-read-ctf/test-callback2.abi",
"output/test-read-ctf/test-callback2.abi",
},
+ // out-of-tree kernel module.
+ {
+ "data/test-read-ctf/test-linux-module.ko",
+ "",
+ "",
+ SEQUENCE_TYPE_ID_STYLE,
+ "data/test-read-ctf/test-linux-module.abi",
+ "output/test-read-ctf/test-linux-module.abi",
+ },
// This should be the last entry.
{NULL, NULL, NULL, SEQUENCE_TYPE_ID_STYLE, NULL, NULL}
};