Objectcode

Objectcode of een objectbestand is in de informatica een representatie die een compiler of assembler heeft gegenereerd na het vertalen van een broncodebestand.[1] Een objectbestand bevat alle machinecode die gevormd kan worden uit de broncode, samen met de informatie die de linker nodig heeft om van een set objectbestanden een werkend programma of bibliotheek te maken.
Voorbeeld
Bibliotheek: ref x00001: 10101010010101001001010 ref x00002: 11001011001010110100010 |
Objectcode: 10010101001010001010100 ref x00001 10100101010001010010010 ref x00002 |
Machinecode (obj + ref): 10010101001010001010100 10101010010101001001010 10100101010001010010010 11001011001010110100010 |
Met een statische linker worden alle afhankelijkheden en bibliotheken gelinkt met de objectcode. Een besturingssysteem kan het uitvoerbaar bestand vervolgens zonder runtime meteen in het geheugen laden en direct starten.[2]
Machine objectcode: 10010101001010001010100 10101010010101001001010 10100101010001010010010 |
Formaten
Voor objectcode bestaan er, net als voor broncode, vele verschillende bestandsformaten.
Windows gebruikt tegenwoordig het Portable Executable-formaat, dat zowel voor DLL's, objectcode en uitvoerbare bestanden wordt gebruikt op alle recente versies van Windows.
Voor Unix-achtige systemen (waaronder Linux) is ELF het populairste formaat, dat ook weer voor alle mogelijke binaire bestanden wordt gebruikt. ELF wordt ook op de PlayStation Portable, PlayStation 2 en enkele andere Unix-gebaseerde systemen gebruikt.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.