]> git.alrj.org Git - bold.git/blobdiff - Bold/linker.py
First support for .gnu.hash/DT_GNU_HASH.
[bold.git] / Bold / linker.py
index 9c4b51e748613206e72ebb536428f66bc35d282b..935b462f5d50c8c5bfefebe7c8b6e06adf7937a4 100644 (file)
@@ -108,9 +108,12 @@ class BoldLinker(object):
     symbols = sorted(list(self.undefined_symbols))
 
     # Those three will soon be known...
-    symbols.remove('_bold__functions_count')
-    symbols.remove('_bold__functions_hash')
-    symbols.remove('_bold__functions_pointers')
+    if '_bold__functions_count' in symbols:
+      symbols.remove('_bold__functions_count')
+    if '_bold__functions_hash' in symbols:
+      symbols.remove('_bold__functions_hash')
+    if '_bold__functions_pointers' in symbols:
+      symbols.remove('_bold__functions_pointers')
 
     # Create the fake ELF object.
     fo = Elf64() # Don't care about most parts of ELF header (?)
@@ -129,7 +132,6 @@ class BoldLinker(object):
     bss_shdr = Elf64_Shdr()
     bss_shdr.sh_type = SHT_NOBITS
     bss_shdr.sh_flags = (SHF_WRITE | SHF_ALLOC)
-    bss_shdr.sh_size = bss_size
     bss_shdr.content = BinArray("")
     fo.shdrs.append(bss_shdr)
     fo.sections['.bss'] = bss_shdr