Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
695edbac
Commit
695edbac
authored
Dec 06, 2012
by
Kostya Serebryany
Committed by
Kostya Serebryany
Dec 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[libsanitizer] merge from upstream r169392
From-SVN: r194255
parent
c8211767
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
19 deletions
+36
-19
libsanitizer/ChangeLog
+4
-0
libsanitizer/MERGE
+1
-1
libsanitizer/asan/asan_interceptors.cc
+0
-2
libsanitizer/tsan/tsan_interceptors.cc
+22
-15
libsanitizer/tsan/tsan_interface_atomic.cc
+7
-1
libsanitizer/tsan/tsan_stat.cc
+1
-0
libsanitizer/tsan/tsan_stat.h
+1
-0
No files found.
libsanitizer/ChangeLog
View file @
695edbac
2012-12-06 Kostya Serebryany <kcc@google.com>
* All files: Merge from upstream r169392.
2012-12-05 Kostya Serebryany <kcc@google.com>
2012-12-05 Kostya Serebryany <kcc@google.com>
* All files: Merge from upstream r169371.
* All files: Merge from upstream r169371.
...
...
libsanitizer/MERGE
View file @
695edbac
1693
71
1693
92
The first line of this file holds the svn revision number of the
The first line of this file holds the svn revision number of the
last merge done from the master library sources.
last merge done from the master library sources.
libsanitizer/asan/asan_interceptors.cc
View file @
695edbac
...
@@ -177,8 +177,6 @@ INTERCEPTOR(void, siglongjmp, void *env, int val) {
...
@@ -177,8 +177,6 @@ INTERCEPTOR(void, siglongjmp, void *env, int val) {
#if ASAN_INTERCEPT___CXA_THROW
#if ASAN_INTERCEPT___CXA_THROW
INTERCEPTOR
(
void
,
__cxa_throw
,
void
*
a
,
void
*
b
,
void
*
c
)
{
INTERCEPTOR
(
void
,
__cxa_throw
,
void
*
a
,
void
*
b
,
void
*
c
)
{
Printf
(
"__asan's __cxa_throw %p; REAL(__cxa_throw) %p PLAIN %p
\n
"
,
__interceptor___cxa_throw
,
REAL
(
__cxa_throw
),
__cxa_throw
);
CHECK
(
REAL
(
__cxa_throw
));
CHECK
(
REAL
(
__cxa_throw
));
__asan_handle_no_return
();
__asan_handle_no_return
();
REAL
(
__cxa_throw
)(
a
,
b
,
c
);
REAL
(
__cxa_throw
)(
a
,
b
,
c
);
...
...
libsanitizer/tsan/tsan_interceptors.cc
View file @
695edbac
...
@@ -617,21 +617,31 @@ TSAN_INTERCEPTOR(int, posix_memalign, void **memptr, uptr align, uptr sz) {
...
@@ -617,21 +617,31 @@ TSAN_INTERCEPTOR(int, posix_memalign, void **memptr, uptr align, uptr sz) {
}
}
// Used in thread-safe function static initialization.
// Used in thread-safe function static initialization.
TSAN_INTERCEPTOR
(
int
,
__cxa_guard_acquire
,
char
*
m
)
{
extern
"C"
int
INTERFACE_ATTRIBUTE
__cxa_guard_acquire
(
atomic_uint32_t
*
g
)
{
SCOPED_TSAN_INTERCEPTOR
(
__cxa_guard_acquire
,
m
);
SCOPED_INTERCEPTOR_RAW
(
__cxa_guard_acquire
,
g
);
int
res
=
REAL
(
__cxa_guard_acquire
)(
m
);
for
(;;)
{
if
(
res
)
{
u32
cmp
=
atomic_load
(
g
,
memory_order_acquire
);
// This thread does the init.
if
(
cmp
==
0
)
{
}
else
{
if
(
atomic_compare_exchange_strong
(
g
,
&
cmp
,
1
<<
16
,
memory_order_relaxed
))
Acquire
(
thr
,
pc
,
(
uptr
)
m
);
return
1
;
}
else
if
(
cmp
==
1
)
{
Acquire
(
thr
,
pc
,
(
uptr
)
g
);
return
0
;
}
else
{
internal_sched_yield
();
}
}
}
return
res
;
}
}
TSAN_INTERCEPTOR
(
void
,
__cxa_guard_release
,
char
*
m
)
{
extern
"C"
void
INTERFACE_ATTRIBUTE
__cxa_guard_release
(
atomic_uint32_t
*
g
)
{
SCOPED_TSAN_INTERCEPTOR
(
__cxa_guard_release
,
m
);
SCOPED_INTERCEPTOR_RAW
(
__cxa_guard_release
,
g
);
Release
(
thr
,
pc
,
(
uptr
)
m
);
Release
(
thr
,
pc
,
(
uptr
)
g
);
REAL
(
__cxa_guard_release
)(
m
);
atomic_store
(
g
,
1
,
memory_order_release
);
}
extern
"C"
void
INTERFACE_ATTRIBUTE
__cxa_guard_abort
(
atomic_uint32_t
*
g
)
{
SCOPED_INTERCEPTOR_RAW
(
__cxa_guard_abort
,
g
);
atomic_store
(
g
,
0
,
memory_order_relaxed
);
}
}
static
void
thread_finalize
(
void
*
v
)
{
static
void
thread_finalize
(
void
*
v
)
{
...
@@ -1508,9 +1518,6 @@ void InitializeInterceptors() {
...
@@ -1508,9 +1518,6 @@ void InitializeInterceptors() {
TSAN_INTERCEPT
(
strncpy
);
TSAN_INTERCEPT
(
strncpy
);
TSAN_INTERCEPT
(
strstr
);
TSAN_INTERCEPT
(
strstr
);
TSAN_INTERCEPT
(
__cxa_guard_acquire
);
TSAN_INTERCEPT
(
__cxa_guard_release
);
TSAN_INTERCEPT
(
pthread_create
);
TSAN_INTERCEPT
(
pthread_create
);
TSAN_INTERCEPT
(
pthread_join
);
TSAN_INTERCEPT
(
pthread_join
);
TSAN_INTERCEPT
(
pthread_detach
);
TSAN_INTERCEPT
(
pthread_detach
);
...
...
libsanitizer/tsan/tsan_interface_atomic.cc
View file @
695edbac
...
@@ -113,7 +113,10 @@ static morder ConvertOrder(morder mo) {
...
@@ -113,7 +113,10 @@ static morder ConvertOrder(morder mo) {
}
}
template
<
typename
T
>
T
func_xchg
(
volatile
T
*
v
,
T
op
)
{
template
<
typename
T
>
T
func_xchg
(
volatile
T
*
v
,
T
op
)
{
return
__sync_lock_test_and_set
(
v
,
op
);
T
res
=
__sync_lock_test_and_set
(
v
,
op
);
// __sync_lock_test_and_set does not contain full barrier.
__sync_synchronize
();
return
res
;
}
}
template
<
typename
T
>
T
func_add
(
volatile
T
*
v
,
T
op
)
{
template
<
typename
T
>
T
func_add
(
volatile
T
*
v
,
T
op
)
{
...
@@ -253,6 +256,9 @@ static void AtomicStore(ThreadState *thr, uptr pc, volatile T *a, T v,
...
@@ -253,6 +256,9 @@ static void AtomicStore(ThreadState *thr, uptr pc, volatile T *a, T v,
thr
->
clock
.
ReleaseStore
(
&
s
->
clock
);
thr
->
clock
.
ReleaseStore
(
&
s
->
clock
);
*
a
=
v
;
*
a
=
v
;
s
->
mtx
.
Unlock
();
s
->
mtx
.
Unlock
();
// Trainling memory barrier to provide sequential consistency
// for Dekker-like store-load synchronization.
__sync_synchronize
();
}
}
template
<
typename
T
,
T
(
*
F
)(
volatile
T
*
v
,
T
op
)
>
template
<
typename
T
,
T
(
*
F
)(
volatile
T
*
v
,
T
op
)
>
...
...
libsanitizer/tsan/tsan_stat.cc
View file @
695edbac
...
@@ -136,6 +136,7 @@ void StatOutput(u64 *stat) {
...
@@ -136,6 +136,7 @@ void StatOutput(u64 *stat) {
name
[
StatInt_atexit
]
=
" atexit "
;
name
[
StatInt_atexit
]
=
" atexit "
;
name
[
StatInt___cxa_guard_acquire
]
=
" __cxa_guard_acquire "
;
name
[
StatInt___cxa_guard_acquire
]
=
" __cxa_guard_acquire "
;
name
[
StatInt___cxa_guard_release
]
=
" __cxa_guard_release "
;
name
[
StatInt___cxa_guard_release
]
=
" __cxa_guard_release "
;
name
[
StatInt___cxa_guard_abort
]
=
" __cxa_guard_abort "
;
name
[
StatInt_pthread_create
]
=
" pthread_create "
;
name
[
StatInt_pthread_create
]
=
" pthread_create "
;
name
[
StatInt_pthread_join
]
=
" pthread_join "
;
name
[
StatInt_pthread_join
]
=
" pthread_join "
;
name
[
StatInt_pthread_detach
]
=
" pthread_detach "
;
name
[
StatInt_pthread_detach
]
=
" pthread_detach "
;
...
...
libsanitizer/tsan/tsan_stat.h
View file @
695edbac
...
@@ -133,6 +133,7 @@ enum StatType {
...
@@ -133,6 +133,7 @@ enum StatType {
StatInt_atexit
,
StatInt_atexit
,
StatInt___cxa_guard_acquire
,
StatInt___cxa_guard_acquire
,
StatInt___cxa_guard_release
,
StatInt___cxa_guard_release
,
StatInt___cxa_guard_abort
,
StatInt_pthread_create
,
StatInt_pthread_create
,
StatInt_pthread_join
,
StatInt_pthread_join
,
StatInt_pthread_detach
,
StatInt_pthread_detach
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment