mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
Print entity size for mergeable sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53303 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f447e3d311
commit
6d82942092
@ -45,15 +45,25 @@ namespace llvm {
|
|||||||
namespace SectionFlags {
|
namespace SectionFlags {
|
||||||
enum Flags {
|
enum Flags {
|
||||||
None = 0,
|
None = 0,
|
||||||
Code = 1 << 0, ///< Section contains code
|
Code = 1 << 0, ///< Section contains code
|
||||||
Writeable = 1 << 1, ///< Section is writeable
|
Writeable = 1 << 1, ///< Section is writeable
|
||||||
BSS = 1 << 2, ///< Section contains only zeroes
|
BSS = 1 << 2, ///< Section contains only zeroes
|
||||||
Mergeable = 1 << 3, ///< Section contains mergeable data
|
Mergeable = 1 << 3, ///< Section contains mergeable data
|
||||||
Strings = 1 << 4, ///< Section contains null-terminated strings
|
Strings = 1 << 4, ///< Section contains null-terminated strings
|
||||||
TLS = 1 << 5, ///< Section contains thread-local data
|
TLS = 1 << 5, ///< Section contains thread-local data
|
||||||
Debug = 1 << 6, ///< Section contains debug data
|
Debug = 1 << 6, ///< Section contains debug data
|
||||||
Linkonce = 1 << 7 ///< Section is linkonce
|
Linkonce = 1 << 7, ///< Section is linkonce
|
||||||
|
// Some gap for future flags
|
||||||
|
EntitySize = 0xFF << 24 ///< Entity size for mergeable sections
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline unsigned getEntitySize(unsigned flags) {
|
||||||
|
return (flags >> 24) & 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline unsigned setEntitySize(unsigned flags, unsigned size) {
|
||||||
|
return ((flags & ~EntitySize) | ((size & 0xFF) << 24));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TargetMachine;
|
class TargetMachine;
|
||||||
|
@ -337,7 +337,8 @@ std::string X86ELFTargetAsmInfo::PrintSectionFlags(unsigned flags) const {
|
|||||||
else
|
else
|
||||||
Flags += ",@progbits";
|
Flags += ",@progbits";
|
||||||
|
|
||||||
// FIXME: entity size for mergeable sections
|
if (unsigned entitySize = SectionFlags::getEntitySize(flags))
|
||||||
|
Flags += "," + utostr(entitySize);
|
||||||
|
|
||||||
return Flags;
|
return Flags;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user