summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohannes Krampf <johannes.krampf@googlemail.com>2014-01-12 11:39:57 -0500
committerKevin O'Connor <kevin@koconnor.net>2014-01-20 12:42:43 -0500
commit0a82fc743c5ec1553f745bec6fc8bc8780088fd8 (patch)
tree28f029e504d33671ccca9b131181f838362cbf99 /scripts
parent9d7d044d693dbefabf943b07cc29584f5cc4297b (diff)
downloadqemu-seabios-0a82fc743c5ec1553f745bec6fc8bc8780088fd8.tar.gz
build: Avoid sort() on unordered classes for python3 compatibility.
Signed-off-by: Johannes Krampf <johannes.krampf@googlemail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/layoutrom.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/layoutrom.py b/scripts/layoutrom.py
index 2f2b189..3e57787 100755
--- a/scripts/layoutrom.py
+++ b/scripts/layoutrom.py
@@ -5,6 +5,7 @@
#
# This file may be distributed under the terms of the GNU GPLv3 license.
+import operator
import sys
# LD script headers/trailers
@@ -79,7 +80,7 @@ def fitSections(sections, fillsections):
print("Error: Fixed section %s has non-zero alignment (%d)" % (
section.name, section.align))
sys.exit(1)
- fixedsections.sort()
+ fixedsections.sort(key=operator.itemgetter(0))
firstfixed = fixedsections[0][0]
# Find freespace in fixed address area
@@ -94,7 +95,7 @@ def fitSections(sections, fillsections):
nextaddr = fixedsections[i+1][0]
avail = nextaddr - addr - section.size
fixedAddr.append((avail, section))
- fixedAddr.sort()
+ fixedAddr.sort(key=operator.itemgetter(0))
# Attempt to fit other sections into fixed area
canrelocate = [(section.size, section.align, section.name, section)
@@ -308,7 +309,7 @@ def outXRefs(sections, useseg=0, exportsyms=[], forcedelta=0):
def outRelSections(sections, startsym, useseg=0):
sections = [(section.finalloc, section) for section in sections
if section.finalloc is not None]
- sections.sort()
+ sections.sort(key=operator.itemgetter(0))
out = ""
for addr, section in sections:
loc = section.finalloc