aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Desnogues <laurent.desnogues@gmail.com>2009-07-30 19:23:49 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 21:23:37 -0500
commit010a0670053ab59ebf03075c70ab3073f029b69a (patch)
tree0be8938d45a275da0e200e633a1850b48b94250c
parente919a4455d3e6bb587b0c1169119d57b98cd4fd6 (diff)
Fix symfind.
this patch fixes an issue in symfind. Assume you have the following symbols: Address Size 0045bca0 00000080 T s0 0045bd20 00000112 T s1 You'll notice that s1 is s0 + size. So the current symfind will find that address 0045bd20 belongs to s0 instead of s1. Laurent Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
-rw-r--r--elf_ops.h2
-rw-r--r--linux-user/elfload.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/elf_ops.h b/elf_ops.h
index 699651c9e1..15928cbb5b 100644
--- a/elf_ops.h
+++ b/elf_ops.h
@@ -67,7 +67,7 @@ static int glue(symfind, SZ)(const void *s0, const void *s1)
int result = 0;
if (key->st_value < sym->st_value) {
result = -1;
- } else if (key->st_value > sym->st_value + sym->st_size) {
+ } else if (key->st_value >= sym->st_value + sym->st_size) {
result = 1;
}
return result;
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 199e9d815e..3a8268b783 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1199,7 +1199,7 @@ static int symfind(const void *s0, const void *s1)
int result = 0;
if (key->st_value < sym->st_value) {
result = -1;
- } else if (key->st_value > sym->st_value + sym->st_size) {
+ } else if (key->st_value >= sym->st_value + sym->st_size) {
result = 1;
}
return result;