Project

General

Profile

Actions

Feature #2159

closed

A step to a general purpose C AOP implementation

Added by Evgeny Novikov almost 13 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Start date:
01/05/2012
Due date:
% Done:

0%

Estimated time:
Published in build:

Description

I'm thinking how can we avoid complex manipulations with cc and ld commands performing in rule-instrumentor. This is required to avoid multiple definitions of symbols (these symbols describe model functions and state). Briefly speaking, at the moment for each cc command both "state" (i.e. including model functions and state) and "non-state" files are obtained. In linking for a final target just one "state" file is taken, while others are "non-state".
Unfortunatelly, this assumes that one should implement something similar to rule-instrumentor cc and ld command manipulations for a general use case of "aspectator" to allow usage of common functions and state. I consider this as a big drawback of our appoach. I found out a workaround for the given problem. We can use option allow-multiple-definition for linker:
  --allow-multiple-definition
  -z muldefs
    Normally when a symbol is defined multiple times, the linker will report a fatal error. These options allow multiple definitions and the first definition will be used.

So, I assume the following use case:
  1. User develops an aspect that contains both relations with sources and common functions and state.
  2. Instead of a default compiler user uses "aspectator" to build just "state" files (in most cases these files will be object files).
  3. Then user links obtained files together by means of "aspectator" that is used also instead of the default compiler. "Aspectator" just adds option "_-Xlinker --allow-multiple-definition_" to gcc on this stage. May be user also should modify CC_FLAGS or/and LD_FLAGS.

As for LDV the last stage isn't performed at all now. But as Pavel has said, CIL can merge the same symbols (I also checked this by myself). That's why there should be no problems. Moreover we'll significantly simplify and speed up rule-instrumentor, in particular caching.

Any ideas?


Related issues 3 (0 open3 closed)

Is duplicate of C Instrumentation Framework - Bug #453: ri: aspect common file should be element of united aspect fileClosedEvgeny Novikov09/23/2010

Actions
Blocked by C Instrumentation Framework - Feature #1672: Easy interface for AspectatorClosedEvgeny Novikov08/22/2011

Actions
Blocked by Linux Driver Verification - Feature #2227: Create a separate subproject for CIF (old "aspectator")ClosedEvgeny Novikov01/17/2012

Actions
Actions

Also available in: Atom PDF