|
|
|
# Copyright 2013-2016 The Meson development team
|
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
|
|
import sys, struct
|
|
|
|
|
|
|
|
SHT_STRTAB = 3
|
|
|
|
DT_NEEDED = 1
|
|
|
|
DT_RPATH = 15
|
|
|
|
DT_RUNPATH = 29
|
|
|
|
DT_STRTAB = 5
|
|
|
|
DT_SONAME = 14
|
|
|
|
DT_MIPS_RLD_MAP_REL = 1879048245
|
|
|
|
|
|
|
|
class DataSizes:
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
def __init__(self, ptrsize, is_le):
|
|
|
|
if is_le:
|
|
|
|
p = '<'
|
|
|
|
else:
|
|
|
|
p = '>'
|
|
|
|
self.Half = p + 'h'
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
self.HalfSize = 2
|
|
|
|
self.Word = p + 'I'
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
self.WordSize = 4
|
|
|
|
self.Sword = p + 'i'
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
self.SwordSize = 4
|
|
|
|
if ptrsize == 64:
|
|
|
|
self.Addr = p + 'Q'
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
self.AddrSize = 8
|
|
|
|
self.Off = p + 'Q'
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
self.OffSize = 8
|
|
|
|
self.XWord = p + 'Q'
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
self.XWordSize = 8
|
|
|
|
self.Sxword = p + 'q'
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
self.SxwordSize = 8
|
|
|
|
else:
|
|
|
|
self.Addr = p + 'I'
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
self.AddrSize = 4
|
|
|
|
self.Off = p + 'I'
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
self.OffSize = 4
|
|
|
|
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
class DynamicEntry(DataSizes):
|
|
|
|
def __init__(self, ifile, ptrsize, is_le):
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
super().__init__(ptrsize, is_le)
|
|
|
|
self.ptrsize = ptrsize
|
|
|
|
if ptrsize == 64:
|
|
|
|
self.d_tag = struct.unpack(self.Sxword, ifile.read(self.SxwordSize))[0]
|
|
|
|
self.val = struct.unpack(self.XWord, ifile.read(self.XWordSize))[0]
|
|
|
|
else:
|
|
|
|
self.d_tag = struct.unpack(self.Sword, ifile.read(self.SwordSize))[0]
|
|
|
|
self.val = struct.unpack(self.Word, ifile.read(self.WordSize))[0]
|
|
|
|
|
|
|
|
def write(self, ofile):
|
|
|
|
if self.ptrsize == 64:
|
|
|
|
ofile.write(struct.pack(self.Sxword, self.d_tag))
|
|
|
|
ofile.write(struct.pack(self.XWord, self.val))
|
|
|
|
else:
|
|
|
|
ofile.write(struct.pack(self.Sword, self.d_tag))
|
|
|
|
ofile.write(struct.pack(self.Word, self.val))
|
|
|
|
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
class SectionHeader(DataSizes):
|
|
|
|
def __init__(self, ifile, ptrsize, is_le):
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
super().__init__(ptrsize, is_le)
|
|
|
|
if ptrsize == 64:
|
|
|
|
is_64 = True
|
|
|
|
else:
|
|
|
|
is_64 = False
|
|
|
|
# Elf64_Word
|
|
|
|
self.sh_name = struct.unpack(self.Word, ifile.read(self.WordSize))[0]
|
|
|
|
# Elf64_Word
|
|
|
|
self.sh_type = struct.unpack(self.Word, ifile.read(self.WordSize))[0]
|
|
|
|
# Elf64_Xword
|
|
|
|
if is_64:
|
|
|
|
self.sh_flags = struct.unpack(self.XWord, ifile.read(self.XWordSize))[0]
|
|
|
|
else:
|
|
|
|
self.sh_flags = struct.unpack(self.Word, ifile.read(self.WordSize))[0]
|
|
|
|
# Elf64_Addr
|
|
|
|
self.sh_addr = struct.unpack(self.Addr, ifile.read(self.AddrSize))[0]
|
|
|
|
# Elf64_Off
|
|
|
|
self.sh_offset = struct.unpack(self.Off, ifile.read(self.OffSize))[0]
|
|
|
|
# Elf64_Xword
|
|
|
|
if is_64:
|
|
|
|
self.sh_size = struct.unpack(self.XWord, ifile.read(self.XWordSize))[0]
|
|
|
|
else:
|
|
|
|
self.sh_size = struct.unpack(self.Word, ifile.read(self.WordSize))[0]
|
|
|
|
# Elf64_Word
|
|
|
|
self.sh_link = struct.unpack(self.Word, ifile.read(self.WordSize))[0]
|
|
|
|
# Elf64_Word
|
|
|
|
self.sh_info = struct.unpack(self.Word, ifile.read(self.WordSize))[0]
|
|
|
|
# Elf64_Xword
|
|
|
|
if is_64:
|
|
|
|
self.sh_addralign = struct.unpack(self.XWord, ifile.read(self.XWordSize))[0]
|
|
|
|
else:
|
|
|
|
self.sh_addralign = struct.unpack(self.Word, ifile.read(self.WordSize))[0]
|
|
|
|
# Elf64_Xword
|
|
|
|
if is_64:
|
|
|
|
self.sh_entsize = struct.unpack(self.XWord, ifile.read(self.XWordSize))[0]
|
|
|
|
else:
|
|
|
|
self.sh_entsize = struct.unpack(self.Word, ifile.read(self.WordSize))[0]
|
|
|
|
|
depfixer: Instance of XXX has no XXX member
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
10 years ago
|
|
|
class Elf(DataSizes):
|
|
|
|
def __init__(self, bfile, verbose=True):
|
|
|
|
self.bfile = bfile
|
|
|
|
self.verbose = verbose
|
|
|
|
self.bf = open(bfile, 'r+b')
|
|
|
|
try:
|
|
|
|
(self.ptrsize, self.is_le) = self.detect_elf_type()
|
|
|
|
super().__init__(self.ptrsize, self.is_le)
|
|
|
|
self.parse_header()
|
|
|
|
self.parse_sections()
|
|
|
|
self.parse_dynamic()
|
|
|
|
except:
|
|
|
|
self.bf.close()
|
|
|
|
raise
|
|
|
|
|
|
|
|
def __enter__(self):
|
|
|
|
return self
|
|
|
|
|
|
|
|
def __exit__(self, exc_type, exc_value, traceback):
|
|
|
|
self.bf.close()
|
|
|
|
|
|
|
|
def detect_elf_type(self):
|
|
|
|
data = self.bf.read(6)
|
|
|
|
if data[1:4] != b'ELF':
|
|
|
|
# This script gets called to non-elf targets too
|
|
|
|
# so just ignore them.
|
|
|
|
if self.verbose:
|
|
|
|
print('File "%s" is not an ELF file.' % self.bfile)
|
|
|
|
sys.exit(0)
|
|
|
|
if data[4] == 1:
|
|
|
|
ptrsize = 32
|
|
|
|
elif data[4] == 2:
|
|
|
|
ptrsize = 64
|
|
|
|
else:
|
|
|
|
sys.exit('File "%s" has unknown ELF class.' % self.bfile)
|
|
|
|
if data[5] == 1:
|
|
|
|
is_le = True
|
|
|
|
elif data[5] == 2:
|
|
|
|
is_le = False
|
|
|
|
else:
|
|
|
|
sys.exit('File "%s" has unknown ELF endianness.' % self.bfile)
|
|
|
|
return ptrsize, is_le
|
|
|
|
|
|
|
|
def parse_header(self):
|
|
|
|
self.bf.seek(0)
|
|
|
|
self.e_ident = struct.unpack('16s', self.bf.read(16))[0]
|
|
|
|
self.e_type = struct.unpack(self.Half, self.bf.read(self.HalfSize))[0]
|
|
|
|
self.e_machine = struct.unpack(self.Half, self.bf.read(self.HalfSize))[0]
|
|
|
|
self.e_version = struct.unpack(self.Word, self.bf.read(self.WordSize))[0]
|
|
|
|
self.e_entry = struct.unpack(self.Addr, self.bf.read(self.AddrSize))[0]
|
|
|
|
self.e_phoff = struct.unpack(self.Off, self.bf.read(self.OffSize))[0]
|
|
|
|
self.e_shoff = struct.unpack(self.Off, self.bf.read(self.OffSize))[0]
|
|
|
|
self.e_flags = struct.unpack(self.Word, self.bf.read(self.WordSize))[0]
|
|
|
|
self.e_ehsize = struct.unpack(self.Half, self.bf.read(self.HalfSize))[0]
|
|
|
|
self.e_phentsize = struct.unpack(self.Half, self.bf.read(self.HalfSize))[0]
|
|
|
|
self.e_phnum = struct.unpack(self.Half, self.bf.read(self.HalfSize))[0]
|
|
|
|
self.e_shentsize = struct.unpack(self.Half, self.bf.read(self.HalfSize))[0]
|
|
|
|
self.e_shnum = struct.unpack(self.Half, self.bf.read(self.HalfSize))[0]
|
|
|
|
self.e_shstrndx = struct.unpack(self.Half, self.bf.read(self.HalfSize))[0]
|
|
|
|
|
|
|
|
def parse_sections(self):
|
|
|
|
self.bf.seek(self.e_shoff)
|
|
|
|
self.sections = []
|
|
|
|
for i in range(self.e_shnum):
|
|
|
|
self.sections.append(SectionHeader(self.bf, self.ptrsize, self.is_le))
|
|
|
|
|
|
|
|
def read_str(self):
|
|
|
|
arr = []
|
|
|
|
x = self.bf.read(1)
|
|
|
|
while x != b'\0':
|
|
|
|
arr.append(x)
|
|
|
|
x = self.bf.read(1)
|
|
|
|
if x == b'':
|
|
|
|
raise RuntimeError('Tried to read past the end of the file')
|
|
|
|
return b''.join(arr)
|
|
|
|
|
|
|
|
def find_section(self, target_name):
|
|
|
|
section_names = self.sections[self.e_shstrndx]
|
|
|
|
for i in self.sections:
|
|
|
|
self.bf.seek(section_names.sh_offset + i.sh_name)
|
|
|
|
name = self.read_str()
|
|
|
|
if name == target_name:
|
|
|
|
return i
|
|
|
|
|
|
|
|
def parse_dynamic(self):
|
|
|
|
sec = self.find_section(b'.dynamic')
|
|
|
|
self.dynamic = []
|
|
|
|
if sec is None:
|
|
|
|
return
|
|
|
|
self.bf.seek(sec.sh_offset)
|
|
|
|
while True:
|
|
|
|
e = DynamicEntry(self.bf, self.ptrsize, self.is_le)
|
|
|
|
self.dynamic.append(e)
|
|
|
|
if e.d_tag == 0:
|
|
|
|
break
|
|
|
|
|
|
|
|
def print_section_names(self):
|
|
|
|
section_names = self.sections[self.e_shstrndx]
|
|
|
|
for i in self.sections:
|
|
|
|
self.bf.seek(section_names.sh_offset + i.sh_name)
|
|
|
|
name = self.read_str()
|
|
|
|
print(name.decode())
|
|
|
|
|
|
|
|
def print_soname(self):
|
|
|
|
soname = None
|
|
|
|
strtab = None
|
|
|
|
for i in self.dynamic:
|
|
|
|
if i.d_tag == DT_SONAME:
|
|
|
|
soname = i
|
|
|
|
if i.d_tag == DT_STRTAB:
|
|
|
|
strtab = i
|
|
|
|
if soname is None or strtab is None:
|
|
|
|
print("This file does not have a soname")
|
|
|
|
return
|
|
|
|
self.bf.seek(strtab.val + soname.val)
|
|
|
|
print(self.read_str())
|
|
|
|
|
|
|
|
def get_entry_offset(self, entrynum):
|
|
|
|
sec = self.find_section(b'.dynstr')
|
|
|
|
for i in self.dynamic:
|
|
|
|
if i.d_tag == entrynum:
|
|
|
|
return sec.sh_offset + i.val
|
|
|
|
return None
|
|
|
|
|
|
|
|
def print_rpath(self):
|
|
|
|
offset = self.get_entry_offset(DT_RPATH)
|
|
|
|
if offset is None:
|
|
|
|
print("This file does not have an rpath.")
|
|
|
|
else:
|
|
|
|
self.bf.seek(offset)
|
|
|
|
print(self.read_str())
|
|
|
|
|
|
|
|
def print_runpath(self):
|
|
|
|
offset = self.get_entry_offset(DT_RUNPATH)
|
|
|
|
if offset is None:
|
|
|
|
print("This file does not have a runpath.")
|
|
|
|
else:
|
|
|
|
self.bf.seek(offset)
|
|
|
|
print(self.read_str())
|
|
|
|
|
|
|
|
def print_deps(self):
|
|
|
|
sec = self.find_section(b'.dynstr')
|
|
|
|
deps = []
|
|
|
|
for i in self.dynamic:
|
|
|
|
if i.d_tag == DT_NEEDED:
|
|
|
|
deps.append(i)
|
|
|
|
for i in deps:
|
|
|
|
offset = sec.sh_offset + i.val
|
|
|
|
self.bf.seek(offset)
|
|
|
|
name = self.read_str()
|
|
|
|
print(name)
|
|
|
|
|
|
|
|
def fix_deps(self, prefix):
|
|
|
|
sec = self.find_section(b'.dynstr')
|
|
|
|
deps = []
|
|
|
|
for i in self.dynamic:
|
|
|
|
if i.d_tag == DT_NEEDED:
|
|
|
|
deps.append(i)
|
|
|
|
for i in deps:
|
|
|
|
offset = sec.sh_offset + i.val
|
|
|
|
self.bf.seek(offset)
|
|
|
|
name = self.read_str()
|
|
|
|
if name.startswith(prefix):
|
|
|
|
basename = name.split(b'/')[-1]
|
|
|
|
padding = b'\0' * (len(name) - len(basename))
|
|
|
|
newname = basename + padding
|
|
|
|
assert(len(newname) == len(name))
|
|
|
|
self.bf.seek(offset)
|
|
|
|
self.bf.write(newname)
|
|
|
|
|
|
|
|
def fix_rpath(self, new_rpath):
|
|
|
|
# The path to search for can be either rpath or runpath.
|
|
|
|
# Fix both of them to be sure.
|
|
|
|
self.fix_rpathtype_entry(new_rpath, DT_RPATH)
|
|
|
|
self.fix_rpathtype_entry(new_rpath, DT_RUNPATH)
|
|
|
|
|
|
|
|
def fix_rpathtype_entry(self, new_rpath, entrynum):
|
|
|
|
if isinstance(new_rpath, str):
|
|
|
|
new_rpath = new_rpath.encode('utf8')
|
|
|
|
rp_off = self.get_entry_offset(entrynum)
|
|
|
|
if rp_off is None:
|
|
|
|
if self.verbose:
|
|
|
|
print('File does not have rpath. It should be a fully static executable.')
|
|
|
|
return
|
|
|
|
self.bf.seek(rp_off)
|
|
|
|
old_rpath = self.read_str()
|
|
|
|
if len(old_rpath) < len(new_rpath):
|
|
|
|
sys.exit("New rpath must not be longer than the old one.")
|
|
|
|
# The linker does read-only string deduplication. If there is a
|
|
|
|
# string that shares a suffix with the rpath, they might get
|
|
|
|
# dedupped. This means changing the rpath string might break something
|
|
|
|
# completely unrelated. This has already happened once with X.org.
|
|
|
|
# Thus we want to keep this change as small as possible to minimize
|
|
|
|
# the chance of obliterating other strings. It might still happen
|
|
|
|
# but our behavior is identical to what chrpath does and it has
|
|
|
|
# been in use for ages so based on that this should be rare.
|
Don't use len() to test emptiness vs not emptiness
Meson has a common pattern of using 'if len(foo) == 0:' or
'if len(foo) != 0:', however, this is a common anti-pattern in python.
Instead tests for emptiness/non-emptiness should be done with a simple
'if foo:' or 'if not foo:'
Consider the following:
>>> import timeit
>>> timeit.timeit('if len([]) == 0: pass')
0.10730923599840025
>>> timeit.timeit('if not []: pass')
0.030033907998586074
>>> timeit.timeit('if len(['a', 'b', 'c', 'd']) == 0: pass')
0.1154778649979562
>>> timeit.timeit("if not ['a', 'b', 'c', 'd']: pass")
0.08259823200205574
>>> timeit.timeit('if len("") == 0: pass')
0.089759664999292
>>> timeit.timeit('if not "": pass')
0.02340641999762738
>>> timeit.timeit('if len("foo") == 0: pass')
0.08848102600313723
>>> timeit.timeit('if not "foo": pass')
0.04032287199879647
And for the one additional case of 'if len(foo.strip()) == 0', which can
be replaced with 'if not foo.isspace()'
>>> timeit.timeit('if len(" ".strip()) == 0: pass')
0.15294511600222904
>>> timeit.timeit('if " ".isspace(): pass')
0.09413968399894657
>>> timeit.timeit('if len(" abc".strip()) == 0: pass')
0.2023209120015963
>>> timeit.timeit('if " abc".isspace(): pass')
0.09571301700270851
In other words, it's always a win to not use len(), when you don't
actually want to check the length.
8 years ago
|
|
|
if not new_rpath:
|
|
|
|
self.remove_rpath_entry(entrynum)
|
|
|
|
else:
|
|
|
|
self.bf.seek(rp_off)
|
|
|
|
self.bf.write(new_rpath)
|
|
|
|
self.bf.write(b'\0')
|
|
|
|
|
|
|
|
def remove_rpath_entry(self, entrynum):
|
|
|
|
sec = self.find_section(b'.dynamic')
|
|
|
|
if sec is None:
|
|
|
|
return None
|
|
|
|
for (i, entry) in enumerate(self.dynamic):
|
|
|
|
if entry.d_tag == entrynum:
|
|
|
|
rpentry = self.dynamic[i]
|
|
|
|
rpentry.d_tag = 0
|
|
|
|
self.dynamic = self.dynamic[:i] + self.dynamic[i + 1:] + [rpentry]
|
|
|
|
break
|
|
|
|
# DT_MIPS_RLD_MAP_REL is relative to the offset of the tag. Adjust it consequently.
|
|
|
|
for entry in self.dynamic[i:]:
|
|
|
|
if entry.d_tag == DT_MIPS_RLD_MAP_REL:
|
|
|
|
entry.val += 2 * (self.ptrsize // 8)
|
|
|
|
break
|
|
|
|
self.bf.seek(sec.sh_offset)
|
|
|
|
for entry in self.dynamic:
|
|
|
|
entry.write(self.bf)
|
|
|
|
return None
|
|
|
|
|
|
|
|
def run(args):
|
|
|
|
if len(args) < 1 or len(args) > 2:
|
|
|
|
print('This application resets target rpath.')
|
|
|
|
print('Don\'t run this unless you know what you are doing.')
|
|
|
|
print('%s: <binary file> <prefix>' % sys.argv[0])
|
|
|
|
sys.exit(1)
|
|
|
|
with Elf(args[0]) as e:
|
|
|
|
if len(args) == 1:
|
|
|
|
e.print_rpath()
|
|
|
|
e.print_runpath()
|
|
|
|
else:
|
|
|
|
new_rpath = args[1]
|
|
|
|
e.fix_rpath(new_rpath)
|
|
|
|
return 0
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
run(sys.argv[1:])
|