svadev AT lists.siebelschool.illinois.edu
Subject: Svadev mailing list
List archive
- From: John Criswell <criswell AT illinois.edu>
- To: Baozeng <sploving1 AT gmail.com>
- Cc: svadev AT cs.illinois.edu
- Subject: Re: [svadev] add metadata information for global and stack variables
- Date: Wed, 30 May 2012 21:28:23 -0500
- List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev>
- List-id: <svadev.cs.uiuc.edu>
On 5/30/12 9:08 PM, Baozeng wrote:
2012/5/31 John
Criswell<criswell AT illinois.edu>:
On 5/30/12 9:03 AM, Baozeng wrote:yes. I added a zeroinitializer to it and it works.
Dear John,
I added metadata information for global and stack variables(commit
r157609 and commit r157670). Then I first test global variable with
the following test:
#include<stdlib.h>
int p[33];
int main() {
p[35] = 8;
return 0;
}
Then
#clang -fmemsafety -bbc globaltest.c -o test
-L/home/sploving/llvm/projects/safecode/Debug/lib
It shows the following error:
/tmp/globaltest-GkBpxH.o:globaltest.c:function sourcefile: error:
undefined reference to 'baggy.metadata1'
I don't see anything immediately wrong. However, I'd like to point out that
in the command above, you're not using the -g option, and in the command
below, you are using the -g option.
Do you get the problem both with and without the -g option?
Its IR file is as the following(clang -g -fmemsafety -bbc globaltest.c
-o test_me.bc -c -emit-llvm
):
; ModuleID = '<stdin>'
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"
target triple = "i386-pc-linux-gnu"
@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32,
void ()* } { i32 0, void ()* @pool_ctor }]
@baggy.metadata = common global { i32, i32* }
@p = common global { [33 x i32], [116 x i8], { i32, i32* } } { [33 x
i32] zeroinitializer, [116 x i8] zeroinitializer, { i32, i32* }*
@baggy.metadata }, align 256
@baggy.metadata1 = internal constant { i32, i32* }
@sourcefile = internal constant { [28 x i8], [28 x i8], { i32, i32* }
} { [28 x i8] c"/home/sploving/globaltest.c\00", [28 x i8]
zeroinitializer, { i32, i32* }* @baggy.metadata1 }, align 64
Try adding a zeroinitializer to the baggy.metadata global variables. I get
an error about them not having any initializer when I try to use BBC with
libLTO.
I also noticed that the metadata is given the same linkage as the global variable. If possible, the metadata should be given internal linkage so that we don't get conflicts between compilation units.
-- John T.
[snip]No. To test it, you'll need to write your own sample programs. Eventually,
What is the matter with my commit?
Another thing, are there any classic examples to test whether BBC
support global and stack variables checking?
we'll want to add lit tests for BBC.
-- John T.
- [svadev] add metadata information for global and stack variables, Baozeng, 05/30/2012
- Re: [svadev] add metadata information for global and stack variables, John Criswell, 05/30/2012
- Re: [svadev] add metadata information for global and stack variables, Baozeng, 05/30/2012
- Re: [svadev] add metadata information for global and stack variables, John Criswell, 05/30/2012
- Re: [svadev] add metadata information for global and stack variables, Baozeng, 05/31/2012
- Re: [svadev] add metadata information for global and stack variables, John Criswell, 05/31/2012
- Re: [svadev] add metadata information for global and stack variables, Baozeng, 05/31/2012
- Re: [svadev] add metadata information for global and stack variables, John Criswell, 05/30/2012
- Re: [svadev] add metadata information for global and stack variables, Baozeng, 05/30/2012
- Re: [svadev] add metadata information for global and stack variables, John Criswell, 05/30/2012
Archive powered by MHonArc 2.6.16.