Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <20240530175107.00001dc2@yahoo.com>
Deutsch   English   Français   Italiano  
<20240530175107.00001dc2@yahoo.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Michael S <already5chosen@yahoo.com>
Newsgroups: comp.lang.c
Subject: Re: C23 thoughts and opinions
Date: Thu, 30 May 2024 17:51:07 +0300
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <20240530175107.00001dc2@yahoo.com>
References: <v2l828$18v7f$1@dont-email.me>
	<00297443-2fee-48d4-81a0-9ff6ae6481e4@gmail.com>
	<v2lji1$1bbcp$1@dont-email.me>
	<87msoh5uh6.fsf@nosuchdomain.example.com>
	<f08d2c9f-5c2e-495d-b0bd-3f71bd301432@gmail.com>
	<v2nbp4$1o9h6$1@dont-email.me>
	<v2ng4n$1p3o2$1@dont-email.me>
	<87y18047jk.fsf@nosuchdomain.example.com>
	<87msoe1xxo.fsf@nosuchdomain.example.com>
	<v2sh19$2rle2$2@dont-email.me>
	<87ikz11osy.fsf@nosuchdomain.example.com>
	<v2v59g$3cr0f$1@dont-email.me>
	<v30l15$3mcj6$1@dont-email.me>
	<v30lls$3mepf$1@dont-email.me>
	<v30sai$3rilf$1@dont-email.me>
	<v320am$1km5$1@dont-email.me>
	<v33ggr$e0ph$1@dont-email.me>
	<v34bne$i85p$1@dont-email.me>
	<v3758s$14hfp$1@raubtier-asyl.eternal-september.org>
	<v38of2$1gsj2$1@dont-email.me>
	<v39v87$1n7bk$1@dont-email.me>
	<20240530170836.00005fa0@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 30 May 2024 16:50:57 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="da80087394b39f0dc93ab771f1b9ace1";
	logging-data="1754093"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19l+7bBVIOeapXcNwdPy8FC/p/knZEs4gs="
Cancel-Lock: sha1:rqj5/q7wUNxMaiiIT2n9LRqVcQQ=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
Bytes: 3748

On Thu, 30 May 2024 17:08:36 +0300
Michael S <already5chosen@yahoo.com> wrote:

> On Thu, 30 May 2024 14:34:00 +0100
> bart <bc@freeuk.com> wrote:
> 
> > On 30/05/2024 03:32, Lawrence D'Oliveiro wrote:  
> > > On Wed, 29 May 2024 13:58:20 +0200, Bonita Montero wrote:
> > >     
> > >> I've got a small commandline-tool that makes a const'd char
> > >> -array from any binary file.    
> > > 
> > > It seems to me it would be more efficient to use objcopy to turn
> > > that binary file directly into an object file with symbols
> > > accessible from C code defining its beginning and ending points.
> > > Then just link it into the executable.    
> > 
> > None of my compilers, whether for C or anything else, generate
> > object files.
> > 
> > However, suppose I wanted to link a file called 'logo.bmp' say, into
> > my program, which consisted of a file called main.c.
> > 
> > What is the entire process using your suggestion? What do I put
> > into main.c? Assume the data is represented by a char-array.
> >   
> 
> extern unsigned char _binary_logo_bmp_start[];
> extern unsigned char _binary_logo_bmp_size[];
> 
> The first symbol is an array itself.
> The seconded symbol contains the length of array. You use it in
> somewhat non-intuitive way:
>   size_t my_size = (size_t)_binary_logo_bmp_size;
> 
> Pay attention that I never used this method myself, just took a look
> at the output of objcopy with 'objdump -t', so please don't take my
> words as a sure thing.
> 
> BTW, options in this case are rather simple:
> objcopy -I binary -O elf32-little logo.bmp logo_bmp.o
> Replace elf32-little with relevant format for your software. However I
> am not sure that it would work for none-elf output formats. 
>

Tested it.
On msys2 it can produce correct pe-x86-64 format but does it in
counter-intuitive way: you have to ask for elf64-x86-64 instead of
pe-x86-64.
I don't know why it works like that. 

The rest of what I wrote above was correct.