void return_input (void) { char array[30]; gets (array); printf("%s\n", array); }
में% gs है इस समारोह निम्नलिखित विधानसभा कोड में बदल जाती है:क्या, जीसीसी में यह संकलन करने के बाद विधानसभा
mov %gs:0x14,%eax xor %gs:0x14,%eax
:
push %ebp mov %esp,%ebp sub $0x28,%esp mov %gs:0x14,%eax mov %eax,-0x4(%ebp) xor %eax,%eax lea -0x22(%ebp),%eax mov %eax,(%esp) call 0x8048374 lea -0x22(%ebp),%eax mov %eax,(%esp) call 0x80483a4 mov -0x4(%ebp),%eax xor %gs:0x14,%eax je 0x80484ac call 0x8048394 leave ret
मैं दो पंक्तियों समझ में नहीं आता % जीएस क्या है, और वास्तव में ये दो पंक्तियां क्या करती हैं?
cc -c -mpreferred-stack-boundary=2 -ggdb file.c
मुझे लगता है कि ये एसएस, डीएस, सीएस, ईएस, एफएस, जीएस - सेगमेंट रजिस्ट्रार हैं। अगर मुझे यह सही मिला। –
संभावित डुप्लिकेट ["एफएस"/"जीएस" रजिस्टर का उद्देश्य क्या है?] (Http://stackoverflow.com/questions/10810203/what-is-the-fs-gs-register-intended-for) –