Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Hello World in Assembly in Eclipse CDT: Build Error(Assembly: "make all" terminated with exit code 2. Build might be incomplete)
Hello World in Assembly in Eclipse CDT: Build Error [message #1834252] Thu, 05 November 2020 19:37
Tom KPB is currently offline Tom KPBFriend
Messages: 18
Registered: November 2020
Junior Member
In Eclipse CDT, I created an Assembly Project and Source File:

File > New > Project > C Project

Empty Project, Cross GCC

Project Name: HelloAsm

Next>

Debug and Release > Finish

Project > Properties > C/C++ Build > Settings

GCC Assembler>

Command: as

Commandline Patterns:

    ${COMMAND} ${FLAGS} ­-g ­­--gstabs ${OUTPUT_FLAG} ${OUTPUT_PREFIX}
    ${OUTPUT} ${INPUTS} 


Apply and Close

File > New > Source File

Source Folder: HelloAsm

Source File: hello.S

Finish

hello.S:

    .section .data
    message: .string "Hello World!\n"
    
    .section .text
    
    # this directive allows the linker to see the "main" label
    # which is our entry point
    .globl main
    
    # this directive allows the eclipse gdb to see a function called "main"
    .func main
    main:
    mov $4, %eax
    mov $1, %ebx
    mov $message, %ecx
    mov $14, %edx
    int $0x80
    mov $0, %eax

Project > Build Project

Error..

Console:

"make all" terminated with exit code 2. Build might be incomplete.
09:41:31 Build Failed. 3 errors, 0 warnings. (took 504ms)

Problems:

./hello.o: relocation R_X86_64_32 against `.data' can not be used when making a PIE object; recompile with -fPIC FirstAsm C/C++ Problem

final link failed: nonrepresentable section on output FirstAsm C/C++ Problem

make: *** [makefile:31: FirstAsm] Error 1 FirstAsm C/C++ Problem

Any help?
Previous Topic:How to change/set the default environment variable append setting?
Next Topic:Signal Functions Like in KEIL
Goto Forum:
  


Current Time: Tue Oct 15 14:57:25 GMT 2024

Powered by FUDForum. Page generated in 0.03204 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top