OpenASIP 2.2
Loading...
Searching...
No Matches
SymbolElement.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file SymbolElement.hh
26 *
27 * Declaration of SymbolElement class.
28 *
29 * @author Jussi Nykänen 2003 (nykanen-no.spam-cs.tut.fi)
30 * @author Mikael Lepistö 2003 (tmlepist-no.spam-cs.tut.fi)
31 * @note reviewed 22 October 2003 by ml, jn, ao, tr
32 *
33 * @note rating: yellow
34 */
35
36#ifndef TTA_SYMBOL_ELEMENT_HH
37#define TTA_SYMBOL_ELEMENT_HH
38
39#include "TPEFBaseType.hh"
40#include "SafePointable.hh"
41#include "SectionElement.hh"
42#include "SafePointer.hh"
43#include "Exception.hh"
44#include "Chunk.hh"
45#include "Section.hh"
46
47namespace TPEF {
48
49/**
50 * Symbol table entry.
51 */
53public:
54 /// Binding types of symbol.
56 STB_LOCAL = 0x0, ///< Not visible outside the object file that
57 ///< contains it's definition.
58 STB_GLOBAL = 0x1, ///< Visible to all files that are combined
59 ///< in TPEF file.
60 STB_WEAK = 0x2 ///< Visible to all object files that are combined
61 ///< in the TPEF file, but with linkage priority
62 ///< lower than STB_GLOBAL symbols.
63 };
64
65 /// Type of symbol element.
67 STT_NOTYPE = 0x0, ///< Type is not defined.
68 STT_DATA = 0x1, ///< Associated with data object.
69 STT_CODE = 0x2, ///< Associated with executable code.
70 STT_SECTION = 0x3,///< Associated with section.
71 STT_FILE = 0x4, ///< Name of symbol gives the name of source file
72 ///< associated with this object file.
73 STT_PROCEDURE = 0x5 ///< Symbol gives indicates procedure start
74 ///< position in section
75 };
76
78 virtual ~SymbolElement();
79
80 /// Returns type of symbol.
81 virtual SymbolType type() const = 0;
82
83 bool absolute() const;
84 void setAbsolute(bool anAbsoluteness);
85
87 void setBinding(SymbolBinding aBinding);
88
89 Chunk* name() const;
90 void setName(Chunk* aName);
92
93 Section* section() const;
94 void setSection(Section* aSect);
96
97private:
98 /// Is symbol absolutely or relocating.
100 /// Binding of the symbol.
102 /// The name of the symbol.
104 /// Section to which the symbol belongs.
106};
107}
108
109#include "SymbolElement.icc"
110
111#endif
SymbolType
Type of symbol element.
@ STT_PROCEDURE
Symbol gives indicates procedure start position in section.
@ STT_FILE
Name of symbol gives the name of source file associated with this object file.
@ STT_CODE
Associated with executable code.
@ STT_NOTYPE
Type is not defined.
@ STT_SECTION
Associated with section.
@ STT_DATA
Associated with data object.
virtual SymbolType type() const =0
Returns type of symbol.
const ReferenceManager::SafePointer * section_
Section to which the symbol belongs.
void setAbsolute(bool anAbsoluteness)
void setName(Chunk *aName)
void setBinding(SymbolBinding aBinding)
bool absolute() const
Section * section() const
SymbolBinding binding() const
bool absolute_
Is symbol absolutely or relocating.
void setName(const ReferenceManager::SafePointer *aName)
void setSection(Section *aSect)
Chunk * name() const
const ReferenceManager::SafePointer * name_
The name of the symbol.
void setSection(const ReferenceManager::SafePointer *aSect)
SymbolBinding
Binding types of symbol.
@ STB_LOCAL
Not visible outside the object file that contains it's definition.
@ STB_WEAK
Visible to all object files that are combined in the TPEF file, but with linkage priority lower than ...
@ STB_GLOBAL
Visible to all files that are combined in TPEF file.
SymbolBinding bind_
Binding of the symbol.