-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
record: Library functions not traced #1903
Comments
Probably. Can you please run the test program (or anything simple) with |
Right, I spotted the
|
Ok, it seems the dynamic section doesn't have the data. But the section header ( |
How about this? diff --git a/libmcount/plthook.c b/libmcount/plthook.c
index 59f8e00b..bbc9c433 100644
--- a/libmcount/plthook.c
+++ b/libmcount/plthook.c
@@ -246,8 +246,22 @@ static int find_got(struct uftrace_elf_data *elf, struct uftrace_elf_iter *iter,
}
if (jmprel_ent_size == 0) {
- pr_dbg("cannot find REL(A)ENT size\n");
- return 0;
+ /*
+ * Some compilers didn't generate DT_REL(A)ENT entry.
+ * Check the section header for the entry size.
+ */
+ elf_for_each_shdr(elf, &sec_iter) {
+ if (sec_iter.shdr.sh_type == SHT_REL ||
+ sec_iter.shdr.sh_type == SHT_RELA) {
+ jmprel_ent_size = sec_iter.shdr.sh_entsize;
+ break;
+ }
+ }
+
+ if (jmprel_ent_size == 0) {
+ pr_dbg("cannot find REL(A)ENT size\n");
+ return 0;
+ }
}
elf_for_each_shdr(elf, &sec_iter) { |
That solves the problem on my machine. Thank you. |
Hey,
On my machine (Oracle 7 x86_64 GCC-6.3), f7ecadb breaks test
001 basic
and many more.getpid()
is missing from the output (see below).Is that related to entry size?
The text was updated successfully, but these errors were encountered: