예제 #1
0
 def crunch(self):
     """Remove all offending content."""
     self.crunch_align()
     self.crunch_redundant()
     if osarch_is_amd64():
         self.crunch_amd64()
     elif osarch_is_ia32():
         self.crunch_ia32()
     self.__tag = None
예제 #2
0
 def crunch(self):
     """Remove all offending content."""
     self.crunch_align()
     self.crunch_redundant()
     if osarch_is_amd64() or osarch_is_ia32():
         self.crunch_amd64_ia32()
     elif is_verbose():
         print("WARNING: no platform-dependent crunch for architecture '%s'" % g_osarch)
     self.__tag = None
예제 #3
0
 def crunch(self):
   """Remove all offending content."""
   while True:
     #lst = self.want_line(r'\s*\.file\s+(.*)')
     #if lst:
     #  self.erase(lst[0])
     #  continue
     #lst = self.want_line(r'\s*\.globl\s+(.*)')
     #if lst:
     #  self.erase(lst[0])
     #  continue
     #lst = self.want_line(r'\s*\.ident\s+(.*)')
     #if lst:
     #  self.erase(lst[0])
     #  continue
     #lst = self.want_line(r'\s*\.type\s+(.*)')
     #if lst:
     #  self.erase(lst[0])
     #  continue
     #lst = self.want_line(r'\s*\.size\s+(.*)')
     #if lst:
     #  self.erase(lst[0])
     #  continue
     lst = self.want_line(r'\s*\.section\s+(.*)')
     if lst:
       self.erase(lst[0])
       continue
     lst = self.want_line(r'\s*\.(bss)\s+')
     if lst:
       self.erase(lst[0])
       continue
     lst = self.want_line(r'\s*\.(data)\s+')
     if lst:
       self.erase(lst[0])
       continue
     lst = self.want_line(r'\s*\.(text)\s+')
     if lst:
       self.erase(lst[0])
       continue
     break
   if osarch_is_amd64():
     self.crunch_amd64(lst)
   elif osarch_is_ia32():
     self.crunch_ia32(lst)
   self.__tag = None
예제 #4
0
def get_align_bytes(op):
    """Due to GNU AS compatibility modes, .align may mean different things."""
    if osarch_is_amd64() or osarch_is_ia32():
        return op
    return 1 << op
예제 #5
0
def can_minimize_align(op):
    """Check if alignment directive can be minimized."""
    # Memory area that is potential source or target of xmm register. Let's not.
    if (op == 16) and (osarch_is_amd64() or osarch_is_ia32()):
        return False
    return True
예제 #6
0
def get_align_bytes(op):
    """Due to GNU AS compatibility modes, .align may mean different things."""
    if osarch_is_aarch64() or osarch_is_amd64() or osarch_is_ia32():
        return op
    return 1 << op
예제 #7
0
def can_minimize_align(op):
    """Check if alignment directive can be minimized."""
    # Memory area that is potential source or target of xmm register. Let's not.
    if (op == 16) and (osarch_is_amd64() or osarch_is_ia32()):
        return False
    return True