There is a simple ld script in order to rebuild the program tinyhello.
//tinyhello.lds
ENTRY(nomain)
SECTIONS
{
. = 0x08048000 + SIZEOF_HEADERS;
tinytext : { *(.text) *(.data) *(.rodata) }
/DISCARD/ : { *(.comment) }
}
$ ld -static -T tinyhello.lds -o tinyhello tinyhello.o // link it using ld with script.