Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > C++ source code compilation

Reply
Thread Tools

C++ source code compilation

 
 
Rui Maciel
Guest
Posts: n/a
 
      12-08-2011
wrote:

>> What's your definition of machine code? And what's your definition of
>> object code?

>
> An object files' purpose is to be read by a piece of software known as a
> linker. An object file contains pointer tables and stuff like that and it
> cannot be read by any machine cpu.
> Object code has been well documented. Just search the web for the
> appropriate documets for ELF and COFF files to find out the deifnition of
> two common object files.


I've asked you about your definition of machine code and object code.
Instead you wrote about object files and their file formats. Could you now
provide your definition of machine code along with your definition of object
code?


Rui Maciel
 
Reply With Quote
 
 
 
 
gwowen
Guest
Posts: n/a
 
      12-08-2011
On Dec 8, 2:21*pm, Rui Maciel <(E-Mail Removed)> wrote:

> I've asked you about your definition of machine code and object code.
> Instead you wrote about object files and their file formats. *Could younow
> provide your definition of machine code along with your definition of object
> code?


Do not feed the troll. He's already unleashed one blast of homophobic
abuse on one person in this thread (and countless others at other
times) and yet people go on feeding him -- what on Earth makes you
think he'll react coherently or intelligently to you.
 
Reply With Quote
 
 
 
 
88888 Dihedral
Guest
Posts: n/a
 
      12-08-2011
On Thursday, December 8, 2011 10:11:20 PM UTC+8, Paul wrote:
> "Rui Maciel" <(E-Mail Removed)> wrote in message
> news:jbqfn2$lao$(E-Mail Removed)...
> > wrote:
> >
> >> Compilers to not output machine code or asm , a compilers output is
> >> object
> >> code.

> >
> > rui@Kubuntu:tmp$ cat main.c
> > int main()
> > {
> > return 0;
> > }
> >
> > rui@Kubuntu:tmp$ gcc -S main.c -o main.s
> > rui@Kubuntu:tmp$ cat main.s
> > .file "main.c"
> > .text
> > .globl main
> > .type main, @function
> > main:
> > .LFB0:
> > .cfi_startproc
> > pushq %rbp
> > .cfi_def_cfa_offset 16
> > .cfi_offset 6, -16
> > movq %rsp, %rbp
> > .cfi_def_cfa_register 6
> > movl $0, %eax
> > popq %rbp
> > .cfi_def_cfa 7, 8
> > ret
> > .cfi_endproc
> > .LFE0:
> > .size main, .-main
> > .ident "GCC: (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1"
> > .section .note.GNU-stack,"",@progbits
> >
> >
> >
> >> Is this an other idiot thats gonna try and argue that machine code is
> >> object code ?

> >
> > What's your definition of machine code? And what's your definition of
> > object code?
> >
> >

>
> An object files' purpose is to be read by a piece of software known as a
> linker. An object file contains pointer tables and stuff like that and it
> cannot be read by any machine cpu.
> Object code has been well documented. Just search the web for the
> appropriate documets for ELF and COFF files to find out the deifnition of
> two common object files.
>


Yes, object files free in tinny C and portable C are somewhat different
from MSVC in using most machine instructions to produce object files
to be linked to run on ARMS, PPC, MIPS, PS3CELL(8cores), WII and etc..
 
Reply With Quote
 
John Bokma
Guest
Posts: n/a
 
      12-08-2011
"Paul" <pchrist<nospam>(E-Mail Removed)> writes:

> "John Bokma" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Leigh Johnston <(E-Mail Removed)> writes:
>>
>>> Paul Reid is a known troll with limited knowledge and arguing with him
>>> is pointless.

>>
>> Thanks for the warning (new here)
>>
>> --
>> John Bokma
>> j3b
>>

>
> Do you want to suck Leigh the faggot jonstons dick you little ****in
> hoofter?
>
> Don't cooment on me again unless you undestand what your ****in talking
> about you little ****in faggot.


You couldn't have made a stronger case to justify the warning. Off you
go.

--
John Bokma j3b

Blog: http://johnbokma.com/ Perl Consultancy: http://castleamber.com/
Perl for books: http://johnbokma.com/perl/help-in-ex...for-books.html
 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      12-08-2011
On Wed, 2011-12-07, Rui Maciel wrote:
> Jorgen Grahn wrote:
>
>> Are you sure of that? Going to (e.g.) x86 assembly language and then
>> invoking the assembler to get x86 object code seems unnecessary
>> complication. I don't see it mentioned in the "GCC internals" document.

>
> He is right. GCC is notoriously organized in front-ends, which translate
> any given programming language into an intermediate language which is
> supported by GCC (it appears to support at least 3 intermediate languages),
> and back-ends, which translate code written in those intermediate languages
> into machine code for a specific target platform.
>
> This approach may appear an "unnecessary complication" at first. Yet, this
> approach means, at least in theory, that you only need to write a new GCC
> front-end in order to get your new programming language to be supported in
> every platform supported by GCC, and it also means that you only need to
> write a new GCC back-end in order to offer support for each and every
> programming language supported by GCC in a brand new target architecture.
>
> Also, by relying on an intermediate implementation it is also possible to
> perform all sorts of code optimization on a single piece of data and yet
> reap benefits from that optimization when writing code in any programming
> language supported by GCC and when targetting any platform supported by GCC.


I am aware of all this, but passing through the stage "x86 assembly
source code" (which was what someone suggested, in the part you
snipped) brings none of the benefits you mention. I don't think it's
done.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
Juha Nieminen
Guest
Posts: n/a
 
      12-09-2011
"Paul" <pchrist <nospam>(E-Mail Removed)> wrote:
>
> "Juha Nieminen" <(E-Mail Removed)> wrote in message
> news:4ee0833c$0$4394$(E-Mail Removed)...
>> "Paul" <pchrist <nospam>(E-Mail Removed)> wrote:
>>> You can't implement C++ exception hadling in asm.

>>
>> That's equivalent to saying that you can't implement C++ exception
>> handling in machine code. Or, in other words, that C++ cannot be compiled
>> (at least not C++ that has exception handling).

>
> asm is the closest thing to cpu intructions, what i call opcodes. And I more
> or less agree that anything you can do in C++ can be done in asm but I
> wouldn't be too fast to jump into an argument about that.
>
> But the main point is that the compilation process nothing to do with
> machine code, the compiler comiles to object code. So asm doesn't come into
> the equation.


Is that your way of saying "I was wrong, you are right"?
 
Reply With Quote
 
Juha Nieminen
Guest
Posts: n/a
 
      12-09-2011
Paavo Helde <(E-Mail Removed)> wrote:
> Could you do a favor to other people (whose killfiles are working) and
> restrain yourself from answering Paul's posts?


Why?

If he spouts complete nonsense and nobody rectifies it, a third-party
reading the thread might end up believing it. After all, if he makes a
claim and nobody responds to it, the claim must therefore be correct and
accepted by everybody else, doesn't it?

The purpose of killfiles is to filter out spam.
 
Reply With Quote
 
Juha Nieminen
Guest
Posts: n/a
 
      12-09-2011
"Paul" <pchrist <nospam>(E-Mail Removed)> wrote:
> Yes it is that ridiculous to suggest that machine code is and object code is
> the same thing.


You see what you did there? The original claim was "object files contain
machine code". Now you have changed it to "an object file and machine code
are the same thing".
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      12-09-2011
On 12/ 9/11 07:31 PM, Juha Nieminen wrote:
> Paavo Helde<(E-Mail Removed)> wrote:
>> Could you do a favor to other people (whose killfiles are working) and
>> restrain yourself from answering Paul's posts?

>
> Why?
>
> If he spouts complete nonsense and nobody rectifies it, a third-party
> reading the thread might end up believing it. After all, if he makes a
> claim and nobody responds to it, the claim must therefore be correct and
> accepted by everybody else, doesn't it?
>
> The purpose of killfiles is to filter out spam.


As well as idiots.

--
Ian Collins
 
Reply With Quote
 
Tobias Müller
Guest
Posts: n/a
 
      12-09-2011
Paavo Helde <(E-Mail Removed)> wrote:
>
> Hi Juha and Leigh,
>
> Could you do a favor to other people (whose killfiles are working) and
> restrain yourself from answering Paul's posts?
>
> Thanks!
> Paavo


If you subtract all that profanity, Pauls arguments are usually not even
that bad. I mean, he is actually right. A compiler produces object code.
Object code however may contain (and usually does) a special form of
machine code (relocatable, not directly executable). So both are right and
there is really no need for such stupid "discussions" that just drive away
people (especially the new ones) from this list.

I know, Paul has a bad reputation, but it does not feel right to "warn"
other people (that don't know him already) from responding to him. He will
probably write something anyway, so give him a chance to write something
useful.

Tobi

PS: Paavo, I just used your post as a starting point, but you're obviously
not the one that I meant with most of the comments.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilation procees of source code arunix C++ 8 09-23-2009 01:36 AM
Panel with vivible=false in source code / large source Jens-Oliver Murer ASP .Net 1 10-17-2008 01:00 PM
Compilation error with seperate compilation C__chp C++ 4 02-15-2008 03:57 PM
Data Recovery SOURCE CODE ( SOURCE CODES of Professional Data Recovery Software ) Author Tarun Tyagi C Programming 0 12-29-2004 05:10 PM
Data Recovery SOURCE CODE ( SOURCE CODES of Professional Data Recovery Software ) Author Tarun Tyagi Cisco 0 12-29-2004 05:03 PM



Advertisments