From mboxrd@z Thu Jan 1 00:00:00 1970 From: MFLD Subject: Question on import symbols generated by BCC Date: Fri, 27 Mar 2015 18:55:48 +0100 Message-ID: <551599A4.7060804@gmail.com> References: <551595A4.7040206@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=ynuW0Cz/xm3S3eiGc4wwoT1hpO26UveC8wHMxm/r6RA=; b=zBB9ygK/ByXnY1lY9eGkADgHNVQERdiYXjq78+0VMsC2/AHMXbGhBWealWAvtaKN6f Bwu9xg2Jmpa5k/Fxu3BeyF4n9dqr+561fKVfTBZHZy3DWb+iLv8IuUf6PsjdGT+H8EIs U57Vw3GqGl117E3x+rqybs1KwC0KS55wJ3/oWeHTSjDRsh0QSaalMcSKjDgly6ApzGwy 21bhSqMBXR/KLWtAVuLAvOZQ7q2KKmQ5JU6n5eGrzD4x0gSENRX8No2Z2NyhAW8NTBpY sRgS030LYH/3rdJ//WlDwpb0dIolF+tl5NZBKxXP/GmbxnmFf5vt4Gt5Llj8tNPU+YXI yTUA== In-Reply-To: <551595A4.7040206@gmail.com> Sender: linux-8086-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: ELKS Hello, > > While compiling a boot code for my embedded device that will load ELKS > from the Flash, I get some trouble while linking several object files > together, some of them are .S compiled with AS86, others are .C > compiled with BCC. Let me explain with a unit test to insulate the > problem: > > Here is the first source file "test1.s": > > .extern _main > .define _entry > .text > _entry: br _main > end > > Here is the second souce file "test2.c": > > extern void entry (); > void main () { entry (); } > > These simple sources make 2 cross references with 2 exports and 2 > imports in each object files. > > Here is the object file generated by "as86 -o test1.o test1.s" > (objdump86 test1.o): > > OBJECTFILE 'test1.o' > MODULE 'test1' > BYTEPOS 00000038 > BINLEN 00000003 > STRINGS 0025 +0013 > VERSION 0.0 > SEG0 00000003 > > SYMS 2 > SYM 0 00000000 ...IT _main > SYM 1 00000000 ..E.T _entry > > text data bss dec hex filename > 3 0 0 3 3 test1.o > > BYTECODE > SEG 0 > : e9 . > RELSZ 2 > DW _main-PC > > In the symbol table, we can see both the public import & text, and the > public export & text. That looks correct. > > Now here is the object file generated by "bcc -ansi -c -o test2.o > test2.c" (objdump86 test2.o): > > OBJECTFILE 'test2.o' > MODULE 'test2' > BYTEPOS 00000038 > BINLEN 0000000c > STRINGS 0025 +0013 > VERSION 0.0 > SEG0 0000000c > > SYMS 2 > SYM 0 00000000 ..E.T _main > SYM 1 00000000 ...IU _entry > > text data bss dec hex filename > 12 0 0 12 c test2.o > > BYTECODE > SEG 0 > : 55 89 e5 57 56 e8 U..WV. > RELSZ 2 > DW _entry-PC > : 5e 5f 5d c3 ^_]. > SEG 3 > > This time, in the symbol table, the public & import symbol _entry has > the 'U' flag, not the 'T' as expected. > > Should not it be flagged 'T' instead ? > > Thanks for your support, > > MFLD > > PS : the "boot code" I am writting is a kind of "coreboot" for 8086, > could I name it "boot86" :-) ?