Commit 3cbf7de4 authored by Diederik van Arkel's avatar Diederik van Arkel
Browse files

make _library eoln agnostic;

slightly more feedback for unknown relocation;
parent 2eeb4259
implementation module linker2;
import StdInt,StdBool,StdString,StdChar,StdArray,StdFile,StdClass,StdMisc;
import UtilNewlinesFile;
:: SymbolArray :== {!Symbol};
......@@ -419,10 +420,10 @@ read_library_files [file_name:file_names] library_n n_library_symbols0 files0 na
read_library_file :: String Int *Files *NamesTable -> (!Bool,!String,!LibrarySymbolsList,!Int,!*Files,!*NamesTable);
read_library_file library_file_name library_n files0 names_table0
# (ok1,library_file0,files1) = fopen library_file_name FReadText files0;
# (ok1,library_file0,files1) = fopen library_file_name FReadData files0;
| not ok1
= (False,"",EmptyLibrarySymbolsList,0,files1,names_table0);
# (library_name0,library_file1) = freadline library_file0;
# (library_name0,library_file1) = readLine library_file0;
library_name1=library_name1;
with {
library_name1 :: {#Char}; // to help the typechecker
......@@ -446,7 +447,7 @@ read_library_file library_file_name library_n files0 names_table0
read_library_symbols :: Int *File *NamesTable -> (!LibrarySymbolsList,!Int,!*File,!*NamesTable);
read_library_symbols symbol_n file0 names_table0
# (symbol_name,file1)=freadline file0;
# (symbol_name,file1)=readLine file0;
| size symbol_name==0
= debug ("libsym: Empty") (EmptyLibrarySymbolsList,symbol_n,file1,names_table0);
| symbol_name .[size symbol_name-1]<>'\n'
......@@ -830,6 +831,8 @@ define_symbols n_symbols symbol_table_string string_table names_table file_n
-> define_symbols_lp (symbol_n+1+n_numaux) names_table0 symbol_table0;
C_STAT
-> define_symbols_lp (symbol_n+1+n_numaux) names_table0 symbol_table0;
unknown
-> abort ("unknown symbol type in linker: " +++ toString unknown +++ ".\n")
};
{
new_symbol_table :: *SymbolTable Int -> .SymbolTable;
......@@ -1005,6 +1008,7 @@ parse_xcoff_header header_string file
error file = (False,0,0,0,file);
}
read_relocations :: !Int !Int !*File -> (!Bool,!String,!*File);
read_relocations offset n_relocations file0
| n_relocations==0
= (True,"",file0)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment